What loop for a local multiplayer game?
Im new to Unity and wanna make the windows console game i created in unity.
I have a playerturn function and in this function im waiting for a input and only if the input is done the code continues. My idea was to just loop one playerturn after another but i dont know where to put this function. Cause when i put it in the update it just doesnt wait for the input and keeps calling the function every frame.
If you start using Unity, you will have to "forget" how console applications work. The logic is very different.
Without any details about what you want to achieve, it will be very difficult to help you. You may want to look at coroutines, but it's an "advanced" topic if you are just starting Unity.
Please, edit your question, explain what you want to achieve and your current code.
Answer by xxmariofer · Mar 18, 2019 at 01:33 PM
something like this might work for you
void Update() { Input.GetKeyDown(KeyCode.A) { TurnManager(); } }
void TurnManager() { //all your turn stuff }
Your answer

Follow this Question
Related Questions
Buggy While loop/Coroutine, which never truly ends? 1 Answer
FindObjectsOfType not find all objects and code not do anything. 0 Answers
Coroutines Madness (); 1 Answer
loop for perimeter of game board 0 Answers
How to stop this infinite loop 1 Answer