- Home /
Photon Unity - Player tag
Hi everyone,
Frankly I'm new to Unity and in particular in Photon Unity.
I'm having 2 players, instantiated over network (blue player and red player). Each prefab has a script attached (player1_script and player2_script) and is tagged as one of the following: Player1/Player2;
For learning/testing purpose, in each script is a simple instruction: if this object is mine and the owner press A key then output in console this object tag.
void Update () {
//if is my player
if(photonView.isMine)
{
if(Input.GetKeyDown(KeyCode.A))
{
Debug.Log(gameObject.tag);
}
}
}
Now i don't understand were is the problem and why don't work. I'm sure i'm missing something, but i'm in the fog.
Thx, and any ideea, any help is welcome.
Thx again!
Your answer
Follow this Question
Related Questions
unity game 1 Answer
Ignore Collision with Tag Error. 1 Answer
Tagged Load level 1 Answer
changing objects color through a raycast? 1 Answer
Make Raycast ignore anything that "Isn't" my player(Solved) 1 Answer