1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. We want to know how you learned Unity! Help us by taking this quick survey and have a chance at a $25 gift card
    Dismiss Notice
  5. Unity 5.6 is now released.
    Dismiss Notice
  6. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice

Unity Multiplayer PHOTON ENEMIES SCENE GLOBAL

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

  1. juniorforestS

    juniorforestS

    Joined:
    Apr 18, 2015
    Posts:
    38
    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:
    38
  3. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    1,852
    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:
    38
    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.