Circular Motion 2d

Hello all i have tried many options and i have no idea why it is not working

i have an object spinning in a circle motion
everything is fine entering good
spin in the way it should
but i want its rotation to be accurate to the movement of the rigidbody moving it

i have tried

if (rigidBody.velocity != Vector2.zero)
            {
                transform.rotation = Quaternion.Euler(0f, 0f, rigidBody.angularVelocity);
            }

//or this  one work ok but jitter 
//i tried in update fixed update late update 

 if (rigidBody.velocity != Vector2.zero)
            {
                var moveVec = new Vector2(rigidBody.velocity.x, rigidBody.velocity.y);
                transform.rotation = Quaternion.LookRotation(Vector3.forward, moveVec);
            }

and many other variations

Please help !

Hi @babi6k,

For which course and lecture is this?

If you just want to spon an object, you could test the Transform.RotateAround method.

Did this help?


See also:

This topic was automatically closed after 5 days. New replies are no longer allowed.

Privacy & Terms