How To Rotate Around Over 360°?

I have two items A and B, they both hover over point C with the same distance in 3D, and B will keep following A.

I had try transform.RotateAround, but the result will become strange due to this method can’t handle the situation when A’s rotation is crossing the line between 0°/360°.

Thanks for your kind help;)

How have you used RotateAround?

As its last value you simply pass how many degrees it should rotate (multiplied by Times.deltaTime for a per frame value). Crossing 360° should not have any meaning in this approach.

You can however also keep track of your own value entirely, increment that each frame, then reset the rotation of the object on the axis in question and use RotateAround with your internal value (without Time.deltaTime).

Neither of these should have any problems crossing 360° to my knowledge.

1 Like

Thank you, there may be some mistake on my normal calculation, i had try another way to achieve this (use Vector3.Lerp to follow A, then project the new position on the Sphere).