I’ve made a scene (2d) with walls (rigidbody2d + boxcolliders2d) - top, down, bottom, left - and a quad moving with an horizontal velocity (there’s no Y component).
I got an script attached to the quad:
using UnityEngine;
using System.Collections;
public class test : MonoBehaviour {
// Use this for initialization
void Start () {
rigidbody2D.velocity = new Vector2(1000f, 0f);
}
// Update is called once per frame
void Update () {
}
void FixedUpdate()
{
Debug.Log(rigidbody2D.velocity);
}
}
But, the quad moves really slow and the console shows that the rigidbody’s X velocity is always 100f (at max) after the initial 1000f set in Start().
This is’n an exact answer, but maybe could help.
Go to edit, project settings, physics2d. Maybe there you can find the problem. (I have similar problems in 3d, here could I solve them.)
Be sure to check other menus in the project settings, (i.e.: Graphics). Lot of problems hides the sollution here.
I have the exact same issue, very strange. One way around it is to continue to use Rigidbody (as in the 3D version), it doesn’t seem to have the same limitation.
Can anyone from Unity shed some light on this? To restate the issue, the linear velocity of Rigidbody2D seems to be capped at 100.0.
The 2D physics engine is strongly tied to scale. When using sprites, adjust the pixels per unit in order to get your objects down to a scale of 1. At that scale, nothing should ever need to go faster than 100 units/second, as that would pretty much teleport them across the screen instantly.
I ran into this same problem. I was using very high-res sprites and trying to work at a much larger scale (large camera size to compensate for large objects). Everything was moving super slow and it was obnoxious, but getting the PPU right fixed everything. If you don’t do that, you’ll start to also have trouble with forces, too.
If you want to Limit the maximum Velocity of A 2dRigidbody you can apply the following script
var max : Vector2;
//here you can assign your maximum values for limiting velocity for both x and y
function Update () {
//this line checks whether the rigidbody exceeded the maximum velocity, and if it is,then limit it to maximum velocity
if (rigidbody2d.velocity.x > max.x)
rigidbody2d.velocity.x = max.x;
//this is the same for y axis
if (rigidbody2d.velocity.x > max.x)
rigidbody2d.velocity.x = max.x;
This is how it is done. I hope you will find it useful