- Home /
How to instantiate a prefab with a shared Network Identity?
I want to be able to instantiate a prefab on all clients that has a shared network identity (so if one client moves or destroys it, it is moved/destroyed on all other clients). However, I can't seem to find any resources on how to do this. Any suggestions?
Answer by Tohron · Jul 10, 2015 at 08:35 PM
To answer my own question - you need a script that extends NetworkBehaviour, on a class with a server-only network ID. The script can instantiate an object (which should also have a network ID), then pass it to NetworkServer.Spawn(object), which instantiates it on all the clients.
Your answer
Follow this Question
Related Questions
problem with RPC instantiate on network 2 Answers
How can I spawn a GameObject on all players in my multiplayer game? 0 Answers
sync tags through network? 0 Answers
Cast a variable over intentiated gameObjects 0 Answers
Network.Instantiate a non-prefab? 1 Answer