Players spawn half-way inside terrain ground

unknown

This has happened so many times now. Players on my game usually (30-45% of the time) spawn in the ground.

unknown

My point of view ^

Their point of view ^

I’ve tried adding more terrain under the map and that did not fix it. I also tried adding a large baseplate under the town and that did not fix it either. The game does use selective rendering since it is a large map.

2 Likes

Move the spawn block up a little?

2 Likes

It’s not inside the ground, however I’ll give that a try. If anyone else has any other ideas, please let me know.

1 Like

Uh, it seems like we’ve already tried that I think,.

2 Likes

It might be because the terrain hasn’t fully loaded on their client before they are teleported. Maybe try setting the WorldGravity on their client to 0 while teleporting and use :MoveTo(position) as it accounts for obstructions.

If you’re using streaming enabled this can be fixed by setting Workspace.StreamingPauseMode to “ClientPhysicsPause”. This allows the map to load before the user lands on it.

2 Likes

Spawn the character a little higher than the exact position they are meant to spawn at, like add a vector (0,10,0) to the CFrame of where the character is meant to spawn so that they do not spawn in the terrain.

2 Likes

Thanks, I’ll give both of these replies a try.

2 Likes

Something like this happened to me once but with a base part below the character. For me it was because the character didn’t fully load before I moved it. This might not be the case for you, but if it is because of the terrain try putting an invisible part below where the player spawns.

2 Likes

Try checking the character’s CollisionGroup and the terrains CollisionGroup. If neither of these match, then you’ll have characters with their legs inside the ground and only supported by their HRP. Try matching each CollisionGroupId and see if that fixes your issue.

1 Like

I already tried that like I said and it didn’t fix the issue. :confused:

2 Likes

Uh, alright, I’ll check it out thanks.

2 Likes

Just realized Terrain isn’t a BasePart, therefore it doesn’t have CollisionGroupId. However, it should have CollsionGroup. If you changed the characters CollisionGroup in any way, try removing the line(s) that do so.

2 Likes

Uh we did that so players can walk through each other.

2 Likes

There’s your issue.

Did this only happen when you set CollisionGroup?

2 Likes

Uh well we didn’t notice it since the game was in-development so we’re not really sure what it is and we found out about it after other updates and then we did beta launch we noticed it happening to players.

2 Likes

How are you setting up each CollisionGroupId of the characters? There’s a few ways to make players not collidable (even without setting CollisionGroup at all).

2 Likes
local PhysService = game:GetService("PhysicsService")

local PlayerGroup = PhysService:CreateCollisionGroup("p")
PhysService:CollisionGroupSetCollidable("p","p",false)

function NoCollide(model)
	for k,v in pairs(model:GetChildren()) do
		if v:IsA"BasePart" then
			PhysService:SetPartCollisionGroup(v,"p")
		end
	end
end```
2 Likes

Try creating a LocalScript with the following contents:

local Players = game:GetService("Players")

for _,player in next, Players:GetPlayers() do
    if (player ~= Players.LocalPlayer) then
        local character = player.Character
        if (character) then
            for _,part in next, character:GetDescendants() do
                if (part:IsA("BasePart")) then
                    part:GetPropertyChangedSignal("CanCollide"):Connect(function()
                        part.CanCollide = false
                    end)
                    part.CanCollide = false
                end
            end
        end
    end
end

Of course, making new characters not collidable with this is totally up to you. This is just a rough example.

Won’t your script will make all the character’s Parts CanCollide off, and therefore allow them to either fall through the map or pass through any obstacles.

  1. I said LocalScript, not Script.
  2. I forgot to add an if statement to check if the player isn’t the LocalPlayer.