SpawnLocation Uses Poll

Hello Developers,

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.

5 Likes

There’s too many problems with players spawning on top of the map because of the way spawn locations work, as well as players being locked into spawns by laggy players.

30 Likes

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.

5 Likes

I don’t use SpawnLocations as intended

###Deterrents:

  • Bug that causes players to get stuck in a tower on spawns
  • 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.

###Desired Behavior:

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])

24 Likes

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.

12 Likes

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.

I had to script my own because the default collision detection is oversensitive. Players were spawning on top of a part that was 15 studs above the spawn.

2 Likes

SpawnLocations could benefit from allowing spawns to occur anywhere above the spawn location instead of limited to the exact center.

For example, resizing a spawn location to a 50 wide 50 long size would allow players to spawn anywhere in that location.

8 Likes

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).

1 Like

Omg yes pls.

I absolutely hate
repeat wait() until Player.Character ~= nil

Doing something like Player:CreateCharacter(parent,spawncframe) would be sooo much neater! (refer to @EchoReaper 's post below on details of what I want)

EDIT: Something like Player:GetCharacter() or Player:WaitForCharacter(timeout) would be nice too. Idk about you guys, but accessing the character through a property doesn’t seem right.

4 Likes

Yep. I’m thinking something like:

local character = player:CreateChracater(userId=myUserId)--diferent UserId would change my appearance
prepareCharacter(character)
player:SpawnCharacter(character, [targetSpawn])

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?

4 Likes

It might be better for the Players Object to handle this rather than the Player. Use case? Making characters spawn in-game as NPCs without having to go through a player.

local npc = game:GetService("Players"):CreateCharacter(userId/Player, R6/R15)
addToControllerList(npc)

If the userID is a -1, then it spawns a blank character of r6/r15.

3 Likes

I enabled what I think is the fix to spawn stacking on production today, can anyone let me know if they see spawn stacking after today? I’m about 80% confident about the fix.

1 Like

This is why I use a self made system. All I do though is place invisible blocks about 15 x 1 x 15 and the player might spawn at either one within the spawn part. Prevents any stacking issues

I creates a custom one because one of my problems with SpawnLocations is that you sometimes spawn on floors and I don’t want to show the teams in the leaderboard, if there is any.

What we need is a way to attach a callback function that gets invoked after a spawn is requested but before the actual parenting and spawning of the player

Idk how it’d work api wise, maybe some sort of function attached to the player
I was thinking it would either pass on the proper player or spawnlocation as an argument either way

I’d rather have this as a function and not an event because it would yield the spawning process until the code is done executing

Throw in a Humanoid.Team property and we’re golden

1 Like

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.

2 Likes

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.

Player.TargetSpawn lets you choose a target spawn if you just want to choose spawn.

How does it work I can’t find anything about it.
Is TargetSpawn a property of the Player or?