system
August 31, 2012, 9:19pm
1
I have a simple plane and a cube in my scene, the cube has a rigidbody + box collider.
I have this script attached to the cube
function OnCollisionEnter(collision: Collision) {
rigidbody.velocity = rigidbody.velocity + Vector3(0,10,0);
}
On every “bounce” the cube starts rotating, this is indicated by the trail renderer I’ve attached.
Why do you guys think its rotating? I cant seem to figure it out.
Any help is appreciated, thanks!
physic calculations are mostly unpredictable. even in real life you will never get an ideal cube and ideal plane to jump directly in ideal direction.
you talking about rotating, but i see a moving on your screen.
anyway, to freeze rotations use rigidbody’s properties
system
August 31, 2012, 10:26pm
3
I’ve figured it out!
I had to go to edit > project settings > Physics
In the inspector you have to set Max Angular Velocity to 0, it stops it from rotating, not sure what the side effects are but at least it solves this problem.