Hi, I want to know how I could find the linear velocity of an object? i.e. how fast it’s going in a certain direction (transform.forward).
The rigidbody has the velocity of a given game object. If you want the projection of one vector onto another then what you are looking for is the dot product
so for c#)…
float speedForward = Vector3.Dot(rigidbody.velocity,transform.forward);
which assumes this is a behaviour on a gameobject with a rigidbody…
these pages may be helpful:
http://www.mvps.org/directx/articles/math/dot/index.htm
http://unity3d.com/support/documentation/ScriptReference/Rigidbody-velocity.html