Today I wanted to talk a little about Spawn Locations. It would seem as if a majority of popular games do not use the SpawnLocation object as intended, instead preferring to script their own system. I would like to know if this is accurate, and if so, why developers chose to not use them. Please lean towards answering why and how SpawnLocations do or do not meet your needs in this post, rather than suggesting singular solutions.
I have included some sample questions to address:
Do you use Spawn Locations as intended? (Without extra scripts). If so, what type of game do you use them in?
Are there any features or properties of SpawnLocations which deter you from using them? If so, what are those features, and in what way are they causing you difficulties?
What spawning feature(s) does your game need(or use already) and what would you like to have added?
TL;DR, any comments you have regarding Spawning is appreciated, and feel free to make complaints or suggestions.
SpawnLocations are fine, but they don’t allow the dynamic nature of how I might want to use them. For instance, I might want to spawn players based on the position of their teammates. Or perhaps in a strategic location away from any enemies. In order to replicate that with SpawnLocations, I’d have to move the SpawnLocations around constantly, in which case it makes more sense just to not use them.
Basically, any game that needs to dynamically change the location of spawn points makes SpawnLocation objects kind of pointless, but not worthless overall.
Still nice to use SpawnLocations to spawn players in a “Spawn Box” to await for the game to place them in the appropriate spot.
If enough players are on the spawn it will start spawning them on the roof (which should be completely inaccessible)
SpawnLocations’ detection for obstacles above detects this spawn pod and places players on top of it
Choosing SpawnLocation via Player.TargetSpawn feels awful to use and I’d prefer Player:Spawn(spawnLocation)
I don’t use the spawn system in general because it doesn’t allow me to prepare characters (e.g. equipping armor) before spawning them
I need to use LoadCharacter to get their character with its most recent CharacterAppearance, but that spawns them in immediately
I could use Players:GetUserAppearanceAsync(), but that’s throttled and is significantly slower than spawning a character with LoadCharacter
I could parent the newly spawned character to nil and then re-add when I’m finished preparing, but the character will show on the spawn for a split second since replication isn’t immediate
I just end up creating my own spawn system to fix these problems – no extra features.
In addition to the above behaviors being fixed, I’d really want a step between loading characters and spawning them which I can prepare them in. Ideally it’d be Player:CreateCharacter(UserId=OwnUserId) which would create a character but not set the Character property (prematurely triggering CharacterAdded), I’d be able to manipulate that, and then I could use Player:LoadCharacter([characterModel], [spawnLocation])
I believe I have a fix for players getting frozen on top of other players when they spawn, it will come out next week. It’s basically impossible to repro locally though so I’m not 100% sure about the fix.
I do use Spawn Locations, but the problem with them is how people spawn in towers and on roofs. Ive coded things in game to prevent that, but it would be nice to fix that with spawn locations if possible to make them a more viable option to use for roblox developers.
Since TargetSpawn I can simply spawn players in front of their allocated building plot, so I don’t need to use additional scripts myself.
For the initial spawn, however, I do need to manually teleport the player after a building plot is allocated (which can be after the player is spawned if a plot of a player who has left is still being saved/unloaded).
I also perform a range of operations on the character after it has spawned, though, which in my opinion would be nice to do before the character has spawned/appearance item is parented to the character (e.g. making hats featherweight).
local character = player:CreateChracater(userId=myUserId)--diferent UserId would change my appearance
TargetSpawn=nil would spawn the character wherever, setting target spawn to a spawn would spawn the character there, and setting it to a model w/ humanoid (not player character or else it won’t support NPCs) would spawn them around that character?
Thinking back on this, it’d be nice if TargetSpawn was renamed to DefaultSpawn, while still having Player:Spawn(…). This would allow easily setting a default spawn while still keeping individual spawn selection as a method, which is more appropriate.
Well I have spent about an hour or two messing around with different methods of spawning a player at a specific location, and I just cant manage to get a player to spawn at the set SpawnLocation. The only way the player will start using the SpawnLocation is after being reset (I may be wrong here.) and even then sometimes it doesn’t function correctly. Sometimes another player may spawn at the wrong SpawnLocation even though the SpawnLocation is set before LoadCharacter() is even called.
I wanna be able to set the SpawnLocation for a given player before calling LoadCharacter()
Anyways I feel that SpawnLocation doesn’t actually work correctly and has potentially a lot to offer in terms of controlling player spawning.
I haven’t tried using teams yet, but I don’t think giving each player a unique team is really a good idea just to control spawning.
Because of the issues with SpawnLocation I have to go about spawning the player elsewhere and then teleporting them to a given location. It’s totally unnecessary to spawn a players character to then reposition them afterwards, but it seems that’s how it has to be.