- Home /
Character movement problem
Hi guys,
I'm currently developing a tactical RPG that the player can play against the PC. However, I'm dealing with a problem.
When I switch the turns between the teams, for instance, the player 1 plays whith the blue characters, then the player 2 (PC) has to play with the orange ones, but it is still the player 1 who plays.
I've tried something like this, however the NPC goes directly to the player position:
if (gameManager.PontoAcaop1 == 0)
{
gameManager.playerTurn = 2;
TurnEnd();
interfaceManager.ChangeTurn();
gameManager.PontoAcaop1 = 4;
player = Personagens[3];
for (int i = 0; i < Personagens.Length; i++)
{
Personagens[i].GetComponent<Jogador>().PodeAtacar = false;
Personagens[i].GetComponent<Jogador>().PodeMovimentar = false;
}
}
I have a gameobject called Player, which is the currently character who plays and an array called Personagens who contains all the 6 characters. When the player 1 finishes his turn, I want the player 2 (PC) to make its movements. I want the player to be the 3 element in the array, like it is the code. But the way that I've code it is not working.
What could I do guys?
Your answer
![](https://koobas.hobune.stream/wayback/20220612230150im_/https://answers.unity.com/themes/thub/images/avi.jpg)