A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
New Unity Live Help updates. Check them out here!
Discussion in 'Scripting' started by Jason210, Apr 6, 2013.
Stuck with this one. I need to know how to get the velocity of another rigidbody in the game....
Vector3 thatVelocity = someGameObject.GetComponent<Rigidbody>().velocity;
var thatVelocity : Vector3 = someGameObject.GetComponent(Rigidbody).velocity;
You don't need GetComponent:
var velocity = otherObject.rigidbody.velocity; // C# and Unityscript
Sorry, I missed your replies. Thanks. It was simpler than I thought!