Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I teleport a model to a player's head?

This is what I tried but the model teleports to a place It cannot be found

local glider = game.Workspace.DefaultGlider:Clone()
wait (2)
glider:MoveTo(Vector3.new(game.Players.LocalPlayer.Character.Head.CFrame * 	CFrame.new(0,5,0)))

3 answers

Thing is: You can't a construct a Vector3 with a CFrame, and you haven't set the parent of the glider

Also, I recommend using SetPrimaryPartCFrame, since MoveTo has collision detection and will position the part above a part, if a part is in the way.

You should note that SetPrimaryPartCFrame can only be used when the Primary part is set, else it'll error. You should preset it in studio

local glider = workspace.DefaultGlider:Clone()
wait(2)
glider:SetPrimaryPartCFrame(game.Players.LocalPlayer.Character.Head.CFrame * CFrame.new(0, 5, 0))
glider.Parent = workspace

1 comment

1

Great answer!

I recommend Using 'Cframe.new' instead of 'Vector3.new'

If that model is supposed to be a ncp then use their torso with

torso.CFrame = CFrame.new(X,Y,Z)
local glider=workspace.DefaultGlider:Clone();
wait(2)
glider:MoveTo(game.Players.LocalPlayer.Character.Head.Position+Vector3.new(0,5,0));

Try this

This discussion is preserved as it was. New answers, comments, and votes are closed.