Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop animation bug #7

Open
MBurtsev opened this issue Jul 24, 2019 · 1 comment
Open

Stop animation bug #7

MBurtsev opened this issue Jul 24, 2019 · 1 comment

Comments

@MBurtsev
Copy link

Hi, Than I added new field in PositionUpdateJob struct https://github.com/stella3d/job-system-cookbook/blob/master/Assets/Scripts/AccelerationParallelFor.cs line36 the сubes stopped moving. My code:

```struct PositionUpdateJob : IJobParallelForTransform
{
    [ReadOnly]
    public NativeArray<Vector3> velocity;  // the velocities from AccelerationJob

    [ReadOnly]
    public Transform[] trans; // here

    public float deltaTime;
    
    public void Execute(int i, TransformAccess transform)
    {
        //trans[i].LookAt(Camera.main.transform.position);

        transform.position += velocity[i] * deltaTime;
    }
}```
@MBurtsev
Copy link
Author

MBurtsev commented Jul 24, 2019

I want to change cubes on quads with textures and they always must LookAt camera position. Like this:
img

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant