:PivotTo() and :MoveTo() not working on character spawn

I’m making a spawn system and for some reason the character wont move to the spawn point when it resets or first spawns in. Anyone know why this could be?
image

Is Player.Data.SpawnPoint a IntValue?

You need to add a wait or .stepped wait to overide the default spawn system.

nope, string value (i added .Value after i posted that)

i tried it wouldnt settle for anything below waiting 1-2 seconds, but thats too much of a noticeable difference

Then something else is interfering.

This is the code sample given in the player documentation for character added which should work in a fresh new baseplate from my experience, if it doesn’t work then something else is up or perhaps it uses .CFrame instead of :PivotTo .

To debug if something else is changing the CFrame value you can use Get property changed signal.

local function onCharacterAdded(character)
local player = Players:GetPlayerFromCharacter(character)
-- Check if we saved a respawn location for this player
if respawnLocations[player] then
-- Teleport the player there when their HumanoidRootPart is available
local hrp = character:WaitForChild("HumanoidRootPart")
-- Wait a brief moment before teleporting, as Roblox will teleport the
-- player to their designated SpawnLocation (which we will override)
RunService.Stepped:wait()
hrp.CFrame = CFrame.new(respawnLocations[player] + Vector3.new(0, 3.5, 0))
end
end

player.CharacterAdded:Connect(onCharacterAdded)

Also what is value in Coordinates? That may be the issue as well.

Why is it not a CFrame Value? Or even a Vector3 value (since you can just do CFrame.new() on the vector3 value)

It just seems better to use.

This issue was fixed when I ran the function on the client instead of the server.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.