Answer the question
In order to leave comments, you need to log in
How to make 2 objects move when interacting with one?
Good day, please tell me how to correctly move 2 objects in different directions at the same time when controlling one. Now I created a boolean variable in the script of one object and pass it to the second object through a singleton.
private void LateUpdate()
{
if (Input.GetKeyUp(KeyCode.W))
{
StartCoroutine(Move(0.1f));
}
if (isMooving == true)
{
StartCoroutine(Move(0.1f));
if (isMooving == false)
return;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question