Teleporting an object

Is there any way to teleport an part to another location in the same place when it touches another part? All the tutorials I found just talked about teleporting people so I’m not sure. Thanks for reading.

3 Likes

Let’s say there’s a part named “MovingPart” and a part named “TargetPart” in the workspace.

local moving = game.Workspace.MovingPart
local target = game.Workpsace.TargetPart

moving.Position  = target.Position

This would make movePart move to Targetpart’s position. Or you can just change MovingPart’s position to whatever point you want. Position is a property of the Part class btw.

movingPart.Position = Vector3.new( x Position, y Position, z Position)
10 Likes

Try this:

local Part = script.Parent
local partToLookFor = workspace:WaitForChild("TeleportTrigger")
local TeleportPosition = CFrame.new(0,2,0)*Part.CFrame

Part.Touched:Connect(function(hit)
      if hit == partToLookFor then
            Part.CFrame = TeleportPosition
      end
end)

Hope this helped.

5 Likes