MoveTo teleports player in the air

Hi, so I am trying to make it play an animation when a prompt is triggered and then teleports a player, but the player seems to be teleporting into the air. and yes the animation has finished playing

script.Parent.Triggered:Connect(function(plr)

local animation_idle = Instance.new("Animation")
animation_idle.AnimationId = "http://www.roblox.com/asset/?id=13955121931"

local animationTrack_idle = plr.Character.Humanoid:LoadAnimation(animation_idle)

local animation_in = Instance.new("Animation")
animation_in.AnimationId = "http://www.roblox.com/asset/?id=13955055656"

local animationTrack_in = plr.Character.Humanoid:LoadAnimation(animation_in)

local animation_out = Instance.new("Animation")
animation_out.AnimationId = "http://www.roblox.com/asset/?id=13954428102"

local animationTrack_out = plr.Character.Humanoid:LoadAnimation(animation_out)

if script.Parent.ActionText == "Hide Under" then
	animationTrack_in:Play()
	wait(5)
	animationTrack_in:Stop()
	plr.Character:MoveTo(Vector3.new(-3.312, 1.621, 24.086))
end

end)

2 Likes

This works totally fine for me. I can only assume your baseplate is a lot lower than that position?

Try print your HumanoidRootPart position before and after it teleports.

-26.036529541015625, 3.0000457763671875, 20.965652465820312

Is that before or after you teleport?

sorry this is -4.953, 11.899, -4.911 and yes

That’s super strange, it seems to set your height to 11.889 which would explain the falling… Are you able to send me a game file so I can investigate this further?

Ok. I sent it to your dms so it should be there

Yeah I honestly have no idea why it didn’t work originally using MoveTo but I was able to solve the problem using PivotTo.

plr.Character:PivotTo(CFrame.new(Vector3.new(-3.312, 1.621, 24.086)))

I totally didn’t get jump scared while testing this.

1 Like

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