I want my character to move sideways when pressing two keys at the same time.
a + e or d + e, the input works, but the character moves just one step. It doesnt continue moving, here is the script:
if (Input.GetKeyDown("a") & Input.GetKeyDown("e"))
TP_Motor.Instance.MoveVector += new Vector3(Input.GetAxis("Horizontal"), 0, 0);
if (Input.GetKeyDown("d") & Input.GetKeyDown("e"))
TP_Motor.Instance.MoveVector += new Vector3(Input.GetAxis("Horizontal"), 0, 0);
The script that moves the character forward and backward works fine. Can you tell me why the difference?
FORWARD AND BACKWARD MOTION:
if (Input.GetAxis("Vertical") > deadZone || Input.GetAxis("Vertical") < -deadZone)
TP_Motor.Instance.MoveVector += new Vector3(0, 0, Input.GetAxis("Vertical"));