A
A
artur_agishev2019-11-24 20:52:51
Unity
artur_agishev, 2019-11-24 20:52:51

How can I make the character move in the given direction when pressing the arrows once until the player presses another arrow??

How to make it so that when pressing the arrows once, the character moves in a given direction until the player presses another arrow?

if (Input.GetKey(KeyCode.RightArrow) && valid(Vector2.right))
                dest = (Vector2)transform.position + Vector2.right;

here is the code please fix it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
namee, 2019-11-25
@namee

Think a little with your head. The basic thing. What do they teach you in class?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question