I am new to “unity 3d”, can someone explain why I can not walk with the ship to the left with the arrow in my draft game?
Walk with all the arrows, but less with the left.
can someone help me?
I put the commands were these:
var vel = 50;
function Start () {
}
function Update () {
if(transform.position.x<=-16){
if(Input.GetKey(KeyCode.LeftArrow)){
transform.Translate(vel*Time.deltaTime*-1,0,0);
}
}
if(transform.position.x<=16){
if(Input.GetKey(KeyCode.RightArrow)){
transform.Translate(vel*Time.deltaTime,0,0);
}
}
{
if(Input.GetKey("up")){
transform.Translate(0,0,vel*Time.deltaTime*-1);
}
}
{
if(Input.GetKey("down")){
transform.Translate(0,0,vel*Time.deltaTime*1);
}
}
}