Enemy View
Options
TyHover
✭
Hello everyone, I have a script that gives rise to 3 enemies (prefabs) in my scene, but every player on the server the enemies are in different places, I wanted to put the enemies as a global enemy, the same enemy for both players, I already tried Put the PhotonView script in the prefab but not right. what do I do? The same problem for another script I have.
0
Comments
-
Be sure to check if they are the master client first, since you don't want all of them doing it... right? Also, you can't just instantiate them like normal. They need to be in your Resources folder, and you need to use PhotonNetwork.InstantiateSceneObject().
So something like...if (PhotonNetwork.isMasterClient) { PhotonNetwork.InstantiateSceneObject("Path_To_Prefab/In_Resources_Folder", SpawnPosition, SpawnQuaternion, 0); }
1 -
and script? Disable an object for all players when any player clicks the key (e)0
-
Send an RPC to everyone. To send an RPC in a script, the gameobject that the script is attached to, must have a PhotonView component. Then, in the script, call "photonView.RPC("FunctionName", PhotonTargets.All);0
-
It continues to disable only for one player0
-
What Config?0