Hi devs ! I have a problem with my script. Actually i want that when a player use the proximity prompt it teleport him to a part. But when I do this, it tp the player under the map. Someone can help me ?
here is the script:
local proximityprompt = script.Parent.Parent.ProximityPrompt
local tweenService = game:GetService("TweenService")
local OpenSound = script.Parent.Parent.Parent["Locker Door Open"]
local CloseSound = script.Parent.Parent.Parent["Locker Door Close"]
local Door1 = script.Parent.Parent.Parent.Door1
local Door2 = script.Parent.Parent.Parent.Door2
local HidePart = script.Parent.Parent.Parent.HidePart
proximityprompt.Triggered:Connect(function(player)
player.Character:SetPrimaryPartCFrame(CFrame.new(HidePart.Position))
OpenSound:Play()
end)
Is the model hallow, and do all of the parts (i.e. HidePart) have CanCollide set to false? If not, it would likely shove them outside of it and back onto the baseplate, but it is possible it is pushing them under the baseplate instead.
I have put somes prints to get the position etc… and the last line is the position of the player when he got teleported . The first and the second line are the position of the part . So we can see the player isn’t teleported to the part .