# Strange behavior of RigidBody with gravity and impulse applied

I'm doing some experiments trying to figure out how physics works in Unity.

I created a cube mesh with a BoxCollider and a RigidBody. The cuve is laying on a mesh plane with a BoxCollider.

I'm trying to update the object position applying a force on its RigidBody. Inside script FixedUpdate function I'm doing the following:

public void FixedUpdate()
{
if (leftButtonPressed())
}


Despite the object is aligned with the world axis and the force is applied along Z axis, it performs a quite big rotation movement around its y axis. Since I didn't modify the center of mass and the BoxCollider position and dimension, all values should be fine.

Removing gravity and letting the object flying without touching the plane, the problem doesn't show. So I suppose it's related to the friction between objects, but I can't understand exactly which is the problem.

Why this? What's my mistake? How can I fix this, or what's the right way to do such a moving an object on a plane through a force impulse?

• Have you tried to set the objects' materials? My answer isn't ok? – fableal Oct 17 '12 at 14:59

I tried to replicate your example and you're right:

I had to set the plane's material to Ice to see the cube moving as it should. Without a material set to the plane, the cube won't "slide" forward (will do a simple somersault) for values like 25, and for bigger values (like 250) the cube's behaviour is really weird!!! (it moves forward, that moves backwards, then starts flying in the upper direction!!! Really funny; here is a link to a video).

To have access to the Ice material you have to import the Physic Materials package.

To set the plane's material you have to select the plane and go to Mesh Collider -> Material.

• +1: yes, actually using ice (dynamic and static friction low, friction/bouncing combine minimum) reduce this problem. I still don't understand the reason. – Heisenbug Oct 22 '12 at 12:55
• Might be due to the physics engine (friction, ...), if you try lowering the cube's mass, you don't have to set materials at all. – fableal Oct 22 '12 at 14:17