rigidbody.velocity.z

Is rigidbody.velocity.z is using Global coordinate? how can I get the local coordinate of velocity.z?

Physics aren’t hierarchical as they all need to respond to stuff. I am not sure exactly what you mean by local, or even how its technically possible to have local physics.

Velocity isn’t a coordinate either, its a vector containing the velocity (the speed it is travelling at).

If you are moving a parent gameobject it will lead to a lot of undesirable physics. Lets assume for a moment you are using joints (because your post expects people to read your mind) - in which case just subtract the other rigid body’s velocity from this rigid body’s velocity. Velocity is just a vector3 and these support subtractions.

I think my question is misleading, I want to get the local velocity of the game object, not the coordinate.

I found the answer here, that solved my problem.
http://answers.unity3d.com/questions/32551/how-do-i-obtain-the-local-velocity-of-a-rigid-body.html

1 Like