Answers for "unityy limit rigidbody velocity"

C#
2

unityy limit rigidbody velocity

if(rigidbody.velocity.sqrMagnitude > maxVelocity)             
             {                 
               //smoothness of the slowdown is controlled by the 0.99f,                  
               //0.5f is less smooth, 0.9999f is more smooth                     
               rigidbody.velocity *= 0.99f;             
             }
Posted by: Guest on December-29-2020
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

C# Answers by Framework

Browse Popular Code Answers by Language