Search Unity

Third Party PHOTON ENEMIES SCENE GLOBAL

Discussion in 'Multiplayer' started by juniorforestS, Jun 17, 2017.

  1. juniorforestS

    juniorforestS

    Joined:
    Apr 18, 2015
    Posts:
    47
    Hi guys, when I connect a room and the enemies are spawned before per other player the enemies don't appear for me just for other player for spawned the enemies don't do part of the scene global but I use:

    PhotonNetwork.automaticallySyncScene = true;
    GameObject enemie= PhotonNetwork.InstantiateSceneObject ("zombieEasy", new Vector3(200, 2, 200), Quaternion.identity, 0, null) as GameObject;

    It only appears to players who were present at the time of birth, but does not appear to those who later enter the room. Will I have to put some Update () mode script to update the enemies? Or JoinRoom () {Update enemies} ??
     
  2. juniorforestS

    juniorforestS

    Joined:
    Apr 18, 2015
    Posts:
    47
  3. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,072
    Put some Debug.Log() in a script on the instantiated GOs to check verify they never get instantiated.
    Either there is a exception when remote players try to instantiate them or you load a scene and scene-loading finished after instantiating the other's characters. That would result in a Destroy call...

    Check the console, too.
     
  4. juniorforestS

    juniorforestS

    Joined:
    Apr 18, 2015
    Posts:
    47
    If the players are together the enemies appear to the two players but if a player enters after the enemies were born appears only to the player who was inside the room.