i at all. i have red id documentation of unity that it possible create static object for simulate, for example, static game geometry like house,wall ecc.
fo do this documentation says that must attach a collider to an gameobject without rigidboy.
http://unity3d.com/support/documentation/Manual/Physics.html
i have do this but when my character controller collide with my wall(that is a static object), character go through it.
my character controller is attach at a camera for simulate first person player.
in my character controller i don't have attached a rigidboy because else its behaviour
is strange.
somebody can help me to solve this problem?
thanks a lot ;)
yes the situation is like you have said ;)
ok now collide my character control ;) error it was a wrong script ;)
so i move my camera by using character controller (first person player).
code :
void Update () {
if(Input.GetKey(KeyCode.W)){
direction = transform.TransformDirection(Vector3.forward);
character.SimpleMove(direction*speed);
}
if(Input.GetKey(KeyCode.S)){
direction = transform.TransformDirection(Vector3.forward);
character.SimpleMove(-direction*speed);
}
if(Input.GetKey(KeyCode.LeftArrow) && !Input.GetKey(KeyCode.W) && !Input.GetKey(KeyCode.S)){
transform.Rotate(0,-rotateSpeed,0);
}
if(Input.GetKey(KeyCode.RightArrow) && !Input.GetKey(KeyCode.W) && !Input.GetKey(KeyCode.S)){
transform.Rotate(0,rotateSpeed,0);
}
if(Input.GetKey(KeyCode.A)){
direction = transform.TransformDirection(Vector3.right);
character.SimpleMove(-direction*speed);
}
if(Input.GetKey(KeyCode.D)){
direction = transform.TransformDirection(Vector3.right);
character.SimpleMove(direction*speed);
}
}
this script works correctly if i press A and S (for go left and backward) but not work if i press W and D.
somebody can illuminate me?