Answer the question
In order to leave comments, you need to log in
When I run the project, the player model only goes to the right, how to fix the code below?
private void Run()
{
Vector3 dir = transform.right * joystick.Horizontal;
transform.position = Vector3.MoveTowards(transform.position, transform.position + dir, speed * Time.deltaTime);
}
Answer the question
In order to leave comments, you need to log in
Well, try to make a Vector3 field, pass the direction coordinates to it and add them to the character's current position
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question