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 myself to a part/brick?

I'm trying to teleport myself to a part using a script but it's not working:

game.Workspace.Vividex.Torso.CFrame = CFrame.new(Vector3.new(game.Workspace.Coin.CFrame))

Sorry if I'm totally off, I'm a nub when it comes to scripting :c

2 answers

I believe that the primary issue here is that you cannot create a Vector3 from a CFrame. Fortunately, you can access the positional part of a CFrame via the member 'p':

	game.Workspace.Vividex.Torso.CFrame = CFrame.new(game.Workspace.Coin.CFrame.p)

Also, you could just create it via the Position property

	game.Workspace.Vividex.Torso.CFrame = CFrame.new(game.Workspace.Coin.Position)

2 comments

0

didn't work :c

0

Well, that depends on a number of things: Where are you running this code?

Hello there!

You can use :MoveTo() command to move your character to somewhere else. so, in this case, it'd be

game.Workspace.Vividex:MoveTo(game.Workspace.Coin.Position)

i hope this works; give it a try!

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