Pretty sure I’ve scripted this correctly but its meant to teleport the player to a part’s position when the certain one of two proximity prompts are triggered (proximity prompt 1 and 2 have different designated parts to teleport to) but instead its teleporting the player to a random position near centre of the map
I’m unsure if there may be a correlation between this and a camera system because theres a camera system that forced the camera in a specific angle based on the orientation of a part anchored in the workspace and whenever the proximity prompt is triggered the player is teleported near it
local HRP = player.Character:FindFirstChild(“HumanoidRootPart”)
local Part = game.Workspace:FindFirstChild(“Part”)
if HRP and Part then
HRP.Position = Part.Position
end
local prompt1 = script.Parent.TeleportDoors.Door1.Door1Prompt
local prompt2 = script.Parent.TeleportDoors.Door2.Door2Prompt
local pospart1 = script.Parent.TeleportParts.TeleportPos1
local pospart2 = script.Parent.TeleportParts.TeleportPos2
prompt1.Triggered:Connect(function(player)
local character = player:WaitForChild("Character")
local HRP = character:WaitForChild("HumanoidRootPart")
HRP.CFrame = CFrame.new(pospart2.Position)
end)
prompt2.Triggered:Connect(function(player)
local character = player:WaitForChild("Character")
local HRP = character:WaitForChild("HumanoidRootPart")
HRP.CFrame = CFrame.new(pospart1.Position)
end)