Answers for "unity how to get player velocity"

C#
4

unity how to set rigidbody velocity

Vector3 velocity = new Vector3(10f/*x*/, 10f/*y*/, 10f/*z*/);
GetComponent<Rigidbody>().velocity = velocity;
Posted by: Guest on December-19-2019
1

rigidbody velocity c# unity

//for rigidbody2D
GetComponent<Rigidbody2D>().velocity =new Vector2(40,0);
Posted by: Guest on September-27-2020
0

unity how to get player velocity

var vel = rigidbody.velocity;      //to get a Vector3 representation of the velocityspeed = vel.magnitude;             // to get magnitude
Posted by: Guest on December-17-2020

Code answers related to "unity how to get player velocity"

C# Answers by Framework

Browse Popular Code Answers by Language