Hi
I’m not sure how to explain this but my player is not stopping completely when he walks into walls. He can get half of his body through the wall before being stopped.
Here’s some general information that could be useful (?).
(That is the player wielding a torch just chilling, WITH A "%# WALL IN HIS HEAD)
Player script
var speed = 3.0;
var rotateSpeed = 3.0;
var bullet : GameObject;
function Update ()
{
if(Input.GetKeyDown("space"))
{
var the_bullet = Instantiate(bullet);
the_bullet.transform.position = transform.position;
the_bullet.transform.rotation = transform.rotation;
}
var controller : CharacterController = GetComponent(CharacterController);
// Rotate around y - axis
transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
// Move forward / backward
var forward = transform.TransformDirection(Vector3.forward);
var curSpeed = speed * Input.GetAxis ("Vertical");
controller.SimpleMove(forward * curSpeed);
}
@script RequireComponent(CharacterController)
How do I fix this? Please help me!
Thanks in advance,
Redoxe