- Home /
[UNET] Trying to spawn GameObject WITHOUT network syncing
Hello -
Me and my friend have been working on a multiplayer FPS using UNet and I'm currently trying to implement a minimap. The minimap works all fine and utilizes a camera and render texture to display on the canvas, but my issue is something that I haven't faced in the year that I've been working on this game: I can't get the minimap camera GameObject to NOT sync across the network! There are no NetworkIdentity components attached, and I've tried a MILLION different ways, including spawning the minimap after the player object is created, making it imitate a child of the GameObject by manually adjusting the values, yet nothing works. The minimap still syncs across the network. Is there a property or function I could use to force a GameObject to NOT spawn across the network? Thanks in advance!
Answer by shrey150 · Jan 19, 2017 at 11:34 AM
I got my answer. I was instantiating the object from a script that derived from NetworkBehaviour
, so I just added an if (isLocalClient)
conditional around GameObject x = Instantiate(thing);
and I got it working.
I could've also moved my code to a script with MonoBehaviour
, but this works too.