get player object in scene
Options
Answers
-
no! if i kill other player, it enable shield on me! and only on my pc! i need to enable shield on new spawned players in room for all PCs!0
-
I'm not sure i understand what you need but, you can use the OnPhotonInstantiate() function to execute something when the GameObject is instantiated. For example:
public void OnPhotonInstantiate(PhotonMessageInfo info) { if (info.sender.isLocal) shield(info.sender.ID, 3f); } IEnumerator shield(int id, float time) { //Send RPC to enable THIS player's shield yield return new WaitForSeconds(time); //Send RPC to disable THIS player's shield yield return 0; }
0