I’m making a game but I’ve got some problems with the moviment,when I use my script to walk the player crosses all the walls:shock:.That’s my code:
/*That script controls the tank moviment*/
var speed=10;
var rotateSpeed:int=50;
function Update ()
{
transform.Rotate(0, Input.GetAxis("Horizontal") * rotateSpeed * Time.deltaTime, 0);
var y = 0;
var z = Input.GetAxis("Vertical") * speed * Time.deltaTime;
transform.Translate(0 , y, z );
}
Thank you