Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity how to get the side ways velocity of a object

Rigidbody rb = GetComponent<Rigidbody>();
Vector3 worldVelocity = rb.velocity;
Vector3 localVelocity = transform.InverseTransformVector(worldVelocity);
//This gives velocity in all directions sideways is on the x axis the thread gives more info
Source by www.reddit.com #
 
PREVIOUS NEXT
Tagged: #unity #side #ways #velocity #object
ADD COMMENT
Topic
Name
8+6 =