Is there a way to fix spawning on the roof?

I keep spawning on the roof in my lobby. Really annoying since the roof is super high up:

Fixing this with scripting seems annoying since the way I would move players is with MoveTo() but then using that would make them spawn on the roof too. CFrame would be great but then I run the risk of players spawning inside each other.

Any ideas?

UPDATE: this only happens when I move the spawns -500 studs or lower. I need them down here so my lobby doesn’t clip with the maps. Can’t move the maps up because I foolishly made some cutscenes w/ CFrame so their positions are pretty much permanent unless I to redo them.

3 Likes

You could make the roof CanCollide false, considering there’s no way to climb the walls.

8 Likes

Put it lower if you want it visible make a fake one then make the real one lower

This usually happens because spawning seems to check for collisions so if for example you have an invisible part above the spawn parts the spawning will put the player above the invisible part, but this shouldn’t happen if the invisible part’s cancollide property is false, and especially shouldn’t happen if there isn’t any invisible part or any part in the way at all. But I do know spawning will make checks to spawn players at the highest safe area when possible, this is the reason why players will spawn on top of eachother’s heads.

My solution would be to have a script check the player’s location a split second after spawning and teleport the player to the spawn using CFrame (with a random offset) if they somehow spawned outside of the intended area due to this issue or if they got flung somehow which ive seen happen in some games.

1 Like

I’ve grown out of using SpawnPoints, I find CFraming the character on spawn is much better as it won’t position the character on top of something.

Example:

local Players = game:GetService("Players")
local Spawns = game:GetService("Workspace"):FindFirstChild("Spawns"):GetChildren()

Players.PlayerAdded:Connect(function(p)
	p.CharacterAdded:Connect(function(char)
		wait() --Won't CFrame the Character if this ain't here.
		local Torso = char:FindFirstChild("Torso")
		if not Torso then --Incase R15
			Torso = char:FindFirstChild("Lower Torso")
		end
		local C_Spawn = Spawns[math.random(1, #Spawns)]
		Torso.CFrame = CFrame.new(C_Spawn.Position) + Vector3.new(0, 2.5, 0)
	end)
end)

Plus it doesn’t spawn the character with a ForceField.

3 Likes

I don’t want to use CFrame:

Also, as an update, this only happens when I move the spawns -500 studs or lower. I need them down here so my lobby doesn’t clip with the maps. Can’t move the maps up because I foolishly made some cutscenes w/ CFrame so their positions are pretty much permanent unless I to redo them.

2 Likes

The risk of players spawning inside each-other isn’t a big problem. It depends on the amount of spawns you have placed in the lobby, and they can be extremely small. From my knowledge if a player is CFramed on another player they just get pushed out of the way of each-other.

Plus all you’d need to do is set the Vector3.new(0, 2.5, 0) in the script to a higher number so they fall when they spawn. Thus basically removing the risk of being CFramed directly into a character.

1 Like

It is a problem. I’ve done the CFrame thing before in this exact game and that happened way more often than I’d like.

It’s not as easy as adding to the Vector3 unless I keep track of everyone that’s standing over a spawn. I’d really like to not add unnecessary code to my already large game.

I appreciate the help, but unfortunately I can’t use CFrame.

I did this but you still spawn like 50 studs above the spawn. Weird.

Is anything blocking the avatar from spawning like parts etc?

local Players = game:GetService("Players")
local Spawns = game:GetService("Workspace"):FindFirstChild("Spawns"):GetChildren()

Players.PlayerAdded:Connect(function(p)
	p.CharacterAdded:Connect(function(char)
		local HRP = char:WaitForChild("HumanoidRootPart")
		local C_Spawn = Spawns[math.random(1, #Spawns)]
		HRP.CFrame = CFrame.new(C_Spawn.Position) + Vector3.new(0, 2.5, 0)
	end)
end)

You can Use HumanoidRootPart instead of finding the Torso and use :WaitForChild() to shorten the code. :+1:t2:

Both R6 & R15 have a Head and HumanoidRootPart so there is no reason to get the Torso

3 Likes

Perhaps, you can turn off collision for players while they’re in the lobby, and you can turn them back on once they’re getting teleported to the map, if you wish.

Also @RuizuKun_Dev

I know I was replying to Wingz_P, and it might be useful to anyone that reads it because a lot of people check for the Torso when they can just do HumanoidRootPart.

I really just want to fix this, but I will keep that in mind as a last resort. Thanks.

@C0_le No. I’m 90% sure now that this is a bug with placing spawners below -500 studs.

1 Like

Maybe related to the part deletion height of -500?

1 Like

I thought that at first too, but it seems I was wrong. It’s actually happening around -400.

I decided to make a bug report for this instead: Players spawn too high over spawns when they're below a certain point

Thanks for the help

3 Likes

Oh, alright