Reply To: Spawning/destroying multiplayer objects?

Forums 💬 FlowCanvas ⚙️ Support Spawning/destroying multiplayer objects? Reply To: Spawning/destroying multiplayer objects?

#22739
Gavalakis
Keymaster

    Hey,
    Very sorry for the late reply.

    So, totally my bad, because the Network.Instantiate method is of the old/legacy unity network system. :/

    The new system uses the ‘NetworkServer.Spawn’ method. Taken from the Unity manual here: http://docs.unity3d.com/Manual/UNetSpawning.html
    …this flowscript should work, although I didn’t test it yet (will do as soon as possible):
    [attachment file=”NetworkSpawn.png”]

    The variable ‘myGameObject’, as per the manual link above, must has a NetworkIdentity component and must also be registered in the NetworkManager “Spawnable Prefabs” which can be done though the inspector of NetworkManager.

    Unfortunately the NetworkServer type would be a bit of a pain to add right now through the Preferred Types Editor, as it resides at the very end of the ‘Add New Type’ menu and under “Classes/UnityEngine/Networking/NetworkServer”.

    The new version soon to be released, has a new search field for types instead of going through all this menus though 🙂

    Please let me know if the above works for you, and I will also post back when I get to try this one.

    Thanks!