Quantcast
Channel: Answers for "Rigidbody - how to stop it quickly"
Viewing all articles
Browse latest Browse all 8

Answer by RafaelCN

$
0
0
You can do something like to slow down the object: public float walkDeacceleration = 5f; public float walkDeaccelerationOnX; public float walkDeaccelerationOnZ; if(Input.GetAxis("Horizontal") == 0 && Input.GetAxis("Vertical") == 0 && grounded) { rigidbody.velocity = new Vector3(Mathf.SmoothDamp(rigidbody.velocity.x, 0, ref walkDeaccelerationOnX, walkDeacceleration), 0, Mathf.SmoothDamp(rigidbody.velocity.z, 0, ref walkDeaccelerationOnZ, walkDeacceleration)); }

Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles





Latest Images