After taking a break from developing, I came back to find my game already hilariously broken. I have a hub area, a loading area that the player is teleported to as the map generates, and the map teleport part that the player teleports to. The part of the map that’s under the teleport part is preloaded so that’s not the issue. When I activate the script that begins the teleport process, it brings the play to the loading area, (which works fine), then when the map is finished generating, it teleport the player to the map teleport part. When I test it however, after the map generates the player falls out the world.
Script:
loadingGUIEvent:FireAllClients("on")
if generateRoomsDefault("Level0") == true then
if char.Humanoid then
char.HumanoidRootPart.CFrame = leveltele[3].CFrame
task.wait(0.5)
char.HumanoidRootPart.CFrame = leveltele[3].CFrame
print("Player Teleported to Level 0!")
updateChunks.Value = true
loadingGUIEvent:FireAllClients("off")
end
end
That value decides wether or not the map is affected by my chunk system, and wouldn’t have an affect as the part of the map around the teleport area is preloaded and not affected.
The floor is anchored and the player is collidable. It appears like the player teleports under the map even though the teleport part is well above the ground
Are you using StreamingEnabled? If so, it is possible that it isn’t yet loaded hence the player falls. To fix it you can either disable StreamingEnabled, or put small bits of the default Terrain for the player to fall onto as the main map loads, as it seems to load a lot quicker
I’ve tried setting position, CFrame, MoveTo, and PivotTo but non of them have worked. I don’t think the parts CFrame coords are nil because the player is either glitching through the floor below the part or above it but is still in its general location.
I actually set up a local server and watched over the tp part location when I walk into the teleporter. It appears as tho the player goes straight into the ground and not into the teleport location. The teleport location is above the ground
When I print the variables, leveltele[3].CFrame is a CFrame, and char.HumanoidRootPart is a part.
If you’re using Rojo, I’d suggest trying out Rojo Studio: https://github.com/LPGhatguy/rojo-studio
The teleport should work fine without having to wait or anything. You can use Rojo Studio to see if your player is getting the correct CFrame or not.