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

Won't tp to right place?

local player = game:GetService("Players").LocalPlayer
mouse = player:GetMouse()
   mouse.Button2Down:connect(function()
player.Character:MoveTo(Vector3.new(mouse.Hit.p))

end)

It takes me to where I spawn, and it only teleports there and infront a little. I have no idea why, no errors, Local Script in backpack (Starterpack)

2 comments

0

Have you tried adding to the vector3? EX. player.Character:MoveTo(Vector3.new(mouse.Hit.p + Vector3.new(0,1,0))) would add 1 to the y axis.

0

Nope

1 answer

✓ Accepted answer

You're basically doing

Vector3.new( Vector3.new() )

which is obviously flawed. mouse.Hit.p is already a Vector3, so just use it;

player.Character:MoveTo(mouse.Hit.p)

Just remember that when Roblox transfers a 2D mouse into 3D space, the result is often not what you want, so something extra or different may have to be done.

1 comment

0

Thank you

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