- Home /
Weird 3D Ball movement after Unity 5 Upgrade
Hi, i recently got a weird problem after upgrading my project to Unity 5.
so, a normal ball with rigidbody attached, are not moving at first load, that's normal. but when i add some impulse forces to the ball it never stop (even i set the Drag
to 1). then i break it's movement by executing this script:
if(Input.getKey(KeyCode.Space))
GetComponent<Rigidbody>().velocity = Vector3.Lerp (GetComponent<Rigidbody>().velocity, Vector3.zero, 0.1f)
it slows down and stop correctly, but when I lift up my finger. the ball are moving again (but in low speed) and I didn't give the ball any command to move them again.
what happens???? it is because of PhysX upgrade maybe????
Comment
Best Answer
Answer by WillNode · Mar 07, 2015 at 08:52 PM
ok, this question is now SOLVED.
it's because of limitation on Mesh Collider on PhysX 3.3. so :
GetComponent<Rigidbody>().isKinematic = false;
if(Input.getKey(KeyCode.Space)){
GetComponent<Rigidbody>().velocity = Vector3.Lerp (GetComponent<Rigidbody>().velocity, Vector3.zero, 0.1f)
if(GetComponent<Rigidbody>().velocity < 0.1f)
GetComponent<Rigidbody>().isKinematic = true;
}
note : this bug is ONLY appear when hit with Mesh Collider.