I’m making a fighting game and trying to debug some things for local multiplayer.
Since i’m doing this in a sort of Traning room, I wanted to deactivate inputs of the player 2 when i’m in the editor, so i put this code in the Start Function:
#if UNITY_EDITOR
Debug.Log("Tentando desativar os inputs",gameObject);
if (gameObject.tag == "Player 2")
{
Debug.Log("Player 2 Input deactivated");
Controller.DeactivateInput();
}
#endif
This should make the object with the tag “Player 2” have their inputs deactivated. However the even when the object has the condititions, DeactivateInput() in never triggered for some reason. And the weirdest this that when moved outside of the if statement, Only Player1 input is deactivated, Player 2 remains active.
Can someone help me with this?