#Designated spawn points

6 messages · Page 1 of 1 (latest)

queen violet
#

Hey there. How do I spawn a player prefab at a specific spawn location? I.e. player selects team blue/red before joining the server, then based on what the player has selected, it spawns the player at the associated spawn point.

I have two NetworkStartPositions setup in my scene, but I can only select Random or Round Robin for a spawn method. Custom logic to move the player location after spawning is a bit of a hacky approach and it is giving me a hard time.

Any advice would be apreciated 🙏

hexed bay
#

@queen violet extend networkmanager and override GetStartPosition

queen violet
#

Ok I've done that and have the logic that spawns the player at the selected spawn location - so that works perfectly, but only for the host. A joining player gets put in the same location as the host, so I need some way to send a message from client to the host to indicate player 2 has selected spawn position Y

hexed bay
#

@queen violet the server sets up the player, sets the spawn location of the player then sends the spawn message to the client to spawn at the location. So, there must be something else you are doing

queen violet
#

Yes that makes sense, but how is the server supposed to know which option the client has selected before it spawns the prefab?

hexed bay
#

@queen violet that will be your game design though. How is the selection set up? Before or after player spawn? Etc.