Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. We're running great holiday deals on subscriptions, swag and Asset Store packages! Take a peek at this blog for more information!
    Dismiss Notice
  3. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  4. Unity 2017.2 is now released.
    Dismiss Notice
  5. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  6. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  8. Unity 2017.3 beta is now available for download.
    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:
    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:
    1,903
    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.