- Home /
How to get tangential velocity of revolving object?
So I have this empty game object which is rotating. Now this has a sphere object as its child. So when the parent point object rotates, the child sphere appears to be revolving around it. I want to know the velocity of that sphere, specifically, its tangential velocity.
When I debug, I find all the components of the sphere rigid body velocity/angular velocity to be (0,0,0). Can anyone please tell me how can I attain this..
Answer by b1gry4n · Apr 08, 2016 at 05:23 PM
If youre rotating the object by manipulating its transform, the rigidbody isnt doing any work. Try rotating it using the rigidbody and you should see some velocity/angular velocity values.
Answer by QuintonH · Apr 08, 2016 at 05:40 PM
Easiest way to go about it would be to find the rotation speed in radians of the parent object and multiply it by the distance between the parent object and the child sphere.
The distance of the child sphere object should be the magnitude of the child object's relative transform position; however, calculating the magnitude of the object uses the costly square root formula. Assuming the distance from the parent and child never changes in this scenario, just set the object at the prefered distance on a single axis and get the value of the non-zero x, y, or z axis and that will be your distance.