I ask this because my character is not colliding with the scene objects. I have a terrain and some cubes with boxcollider. But the character (with rigidbody and cylindercollider) walks through them. I move the character with transform.Translate(…).
#pragma strict
var movSpeed:float = 5f;
var rotSpeed:float = 150f;
function FixedUpdate ()
{
transform.Translate(Vector3.forward * Input.GetAxis("Vertical") * movSpeed * Time.deltaTime);
transform.eulerAngles.y += Input.GetAxis("Horizontal") * rotSpeed * Time.deltaTime;
}
Ok, the problem was that I forgot to uncheck ‘is kinematic’ flag in RigidBody component. That solved the colision issue, but now sometimes the character starts to slide over the terrain (without any input). Why?
I don’t know how to properly set up my character and the scene objects with the physic system.