Hi
Struggling with this scrip lark. I’m trying to get my ship to go fowards and backwards (Z Axis). I can get it to go sideways but not up or down can anyone help ???
Many thanks
Matt ![]()
using UnityEngine;
using System.Collections;
public class PlayerMovement : MonoBehaviour {
public float Speed = 10f;
void Update () {
float LeftRightMovement = Input.GetAxis(“Horizontal”) * Speed * Time.deltaTime;
float UpDownMovement = Input.GetAxis(“Vertical”) * Speed * Time.deltaTime;
transform.Translate(LeftRightMovement,0,0);
transform.Translate(UpDownMovement,0,0);
}
}
P.s. Even when i use the up down arrow key, it goes left and right also ![]()