i was making a teleporter to another level and i got this message :
16:29:17.734 - Position is not a valid member of Model 16:29:17.734 - Stack Begin 16:29:17.735 - Script 'Workspace.Level1.TeleportStick.Part.TeleportScript', Line 3 - function teleportOnTouch 16:29:17.735 - Stack End
i was confused and until now, i still dont know the answer
the code :
function teleportOnTouch(partTouching) if partTouching.Parent:FindFirstChild("Humanoid") then partTouching.Parent.HumanoidRootPart.Position = workspace.Level2.TeleportStick.Position + Vector3.new(0, 5, 0) end end script.Parent.Touched:Connect(teleportOnTouch)
partTouching.Parent.HumanoidRootPart.CFrame = CFrame.new(workspace.Level2.TeleportStick.Position + Vector3.new(0, 5, 0))
Try using CFrames
Change your code to this:
function teleportOnTouch(partTouching) if partTouching.Parent:FindFirstChild("Humanoid") then partTouching.Parent.HumanoidRootPart.CFrame = CFrame.new(workspace.Level2.TeleportStick.Position + Vector3.new(0, 5, 0)) end end script.Parent.Touched:Connect(teleportOnTouch)
This basically changes where the player's humanoidrootpart is and "teleports" the humanoidrootpart which basically takes the whole player where the humanoidrootpart is