- Home /
Do rigidbodies (especially 2d) have limits on their velocities?
I have discovered that despite setting the velocity of a rigidbody to well above the value the velocity seems to cap at 5000.
GetComponent<Rigidbody2D>().velocity = new Vector2(0, 10000);
Debug.Log(GetComponent<Rigidbody2D>().velocity);
But when I debug the velocity it is only 5000 in y axis at maximum. The object does move but not nearly as fast as I would want it to.
This is how the rigidbody is set up (if it helps):
Any insight into what I am doing wrong or what causes this behaviour would be helpful. I have attempted to look up this question several times only finding information about constraining the velocity manually rather than unity doing it automatically, but sorry if I have missed something obvious.
Answer by Jem_hunter · Dec 11, 2018 at 05:34 PM
Okay, so I figured it out and feel a little silly for not checking this before. I will leave the question here because it might help someone and this was hard to find even if it is obvious once you know it.
It is the Maximum Translation Speed value which limits the maximum speed of 2D rigidbodies. So in order to allow for a larger velocity simply increase this value. It is found under: Edit, Project Settings, Physics 2D
I am not fully sure of the processing effects of changing this value, so if many objects are moving and interacting at higher speeds I am sure extra cpu usage is incurred. However for a low number of objects (1-2) I haven't seen any noticeable effect.
This setting does not exist for 3D hence why I did not find it at first (and I don't think it is constrained this way).
Your answer
Follow this Question
Related Questions
Player movement not working with unity 5 1 Answer
move 2d character affected by physics with velocity and/or add force 2 Answers
ball's collider sometimes catches an edge and bounces. when ball rolls over two aligned platforms 1 Answer
Countering AddForce by Modifying velocity 3 Answers
Ball getting stuck in surfaces and bouncing for no reason? Help! 0 Answers