- Home /
Network: Random spawn
How does the new spawning system work? (UNET) I have set the player as my character and spawn method to random, but when he spawns he just ends up at
0,0,0
Why is this? Have I misunderstood the feature?
Makak
Answer by KaldrisRelm · Sep 03, 2015 at 09:09 PM
When UNET spawns a player prefab it looks for any gameObjects with the component 'Network Start Position'. If it can't find any of those it defaults to 0,0,0 world coordinates.
If you want to create multiple spawn locations you'll need to create GameObjects in your scene with the Network Start Position attached. Random mode simply chooses one of the Start Positions randomly when the Prefab is spawned.
If you want a truly random spawn, let everything spawn through UNET at 0,0,0 - then call a script to move the gameobject to a random location after the fact.
Thank you, that cleared up alot of confusion.
$$anonymous$$akak
Your answer
Follow this Question
Related Questions
Object Spawner acts really badly, 0 Answers
Spawning In Photon C# 1 Answer
Spaw dynamic (unregistered) object on network (UNET) 0 Answers
NetworkServer method to spawn map objects (once in a match) 0 Answers