Spawn point spawns me mid-air, instead of at the spawn point

I’ve been having an issue where the spawn point spawns me in mid air above the spawn point. I believe this is because I have the spawn point inside a part, with can-collide equal to false. Is there a way where I can fix this potentially? The can-collide part is intended for the games functionality (music regions), so It’d be a bummer if this is unable to be fixed. If you need me to inform you with more details, let me know.

Apologies if this isn’t the right category…

2 Likes

This isn’t a scripting issue, more of a game design issue.
Spawn points create players above their center point, but if that spawn point is in another Part(s) it’ll create them above that Part(s).
How big is the Part you are spawning above? I’m guessing big enough to create a noticeable drop when you join.
Are the music regions controlled by the size of the Part?

1 Like

Is there a team associated to the spawn? If yes, is the team auto-assignable? Is the spawn set to neutral?

1 Like

Essentially the music regions cover a certain area of the map, playing music when you enter that area of the map.

If you put a spawn in the part, the position will be the position of the part. You might want to make the spawn seperate by itself in the workspace.

1 Like

is the spawn point physically low in the game?

Like is it at a low height? If it is, Spawnpoints have a terrible bug where if it is below a certain physical distance in the actual game, they spawn you where the bug just begins.

1 Like

The spawn is in the part which is ten times larger than it. I’m making an obby game, and when the player dies, it re-spawns at every checkpoint in mid-air above the checkpoint they were last at because of the sound region covering the area.

No, it’s because there is a spawn point within another part which is making them spawn above the can-collide part.

1 Like

This might give you a better idea of what I mean.

Is your zone a part or something? Or a region

1 Like

The sound region is the large (invisible) part, I spawn above it.

1 Like

That might be the reason why. You might want to search up on region3

1 Like

Already have that in my script.

while wait(.5) do
	
	for i, v in pairs(SoundRegionsWorkspace:GetChildren()) do
		local sound = script.Parent.SoundRegions[v.Name]
		
		Found = false
		local region = Region3.new(v.Position - (v.Size/2),v.Position + (v.Size/2))
		
		local parts = game.Workspace:FindPartsInRegion3WithWhiteList(region, game.Players.LocalPlayer.Character:GetDescendants())
		
		
		for _, part in pairs(parts) do
			if part:FindFirstAncestor(game.Players.LocalPlayer.Name) then
				print("Player Was Found")
				Found = true
				break
			else
				Found = false
				print("Player Not Found")
			end
		end		

Going to bump this, haven’t had any luck so far.

Update on everything we know so far. This is what’s causing this issue:

Creating collision groups are essential to fixing this problem, however my checkpoints are custom (so is the spawn point), so it still doesn’t work for that reason being probably. (it works if you’re using normal spawn points)

After testing a few more things, it seems to me that its the obby script is the one thats breaking this which is the main script for things such as the datastores, check-points, leaderstats, etc. I’ll provide the the obby script below because I’m still unsure that’ll I’ll be able to solve this myself. Let me know if you want more information on the script, or anything in general surrounding this issue.

	plr.CharacterAdded:Connect(function(char)
		local hum = char:WaitForChild("Humanoid")
		wait()
		
		char:MoveTo(checkpoints[v.Value].Position)
		
		hum.Touched:Connect(function(hit)
			
			if hit.Parent == checkpoints and char.Humanoid.Health ~= 0 then
				if tonumber(hit.Name) == v.Value +1 then
					v.Value = v.Value +1
				end
				
			elseif hit.Parent == workspace.Objects.Kills then
				char.Humanoid.Health = 0
			end
		end)
	end)
2 Likes

Going to bump this again, pretty close to solving this issue.

You could just teleport the user to the spawn point right as they load.

workspace.ChildAdded:Connect(function(c)
    if game.Players:FindFirstChild(c.Name) then -- in case it isn't a player
       c:SetPrimaryPartCFrame(CFrame.new(workspace.SpawnLocation.Position+Vector3.new(0,5,0)))
    end
end

This will probably work if the user resets, I am unsure if it works when the user joins but use CharacterAdded if it doesn’t work the first time.

(Untested)

4 Likes

I have custom check-points, so that wouldn’t necessarily work for: (workspace.SpawnLocation.Position+Vector3.new(0,5,0)))

I’m sure you’ve figured this out by now or have moved on to other projects but just in case I think I might know how to fix your problem.

You’re using Model:MoveTo() to move your character. This function avoids allowing the model to intersect with other parts.
What I would recommend is setting the CFrame of your character’s HumanoidRootPart instead. This ignores collision (which means you could get stuck in a wall if that’s where you try to teleport.)

		local hum = char:WaitForChild("Humanoid")
		wait()
		
		local RootPart = char:WaitForChild("HumanoidRootPart")
		RootPart.CFrame = CFrame.new(checkpoints[v.Value].Position)
		
		hum.Touched:Connect(function(hit)
			
			if hit.Parent == checkpoints and char.Humanoid.Health ~= 0 then
				if tonumber(hit.Name) == v.Value +1 then
					v.Value = v.Value +1
				end
				
			elseif hit.Parent == workspace.Objects.Kills then
				char.Humanoid.Health = 0
			end
		end)
	end)

This might also be a non-issue now because I can’t seem to recreate the issue with characters spawning above can-collide false parts when using a regular spawn point so perhaps the MoveTo function doesn’t do this anymore either. I don’t know, I haven’t tested.

Sorry for the necro.

I’ve found that using an R6 character caused this to happen to me, but using R15 fixes it. I wish there was an ignore obstructions function so you can just spawn inside the part. The only way to fix this is to create your own spawning system to overtake roblox’s spawning system, or use Region3.