Prompt Teleportation BUG

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)

Here is the video :

1 Like

I forgot to say but the part “HidePart” is in the locker

Try changing this to :PivotTo()
SetPrimaryPartCFrame is deprecated, which could be causing issues.

I just tried and it still not working , the player is still teleported under the map

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.

1 Like

Yes the part “HidePart” Collide is set to false

1 Like

Why not try
player.Character.PrimaryPart.CFrame = CFrame.new(HidePart.Position)

2 Likes

I was just about to say that… lol

1 Like

Still teleport the player under the map…

1 Like

print out HidePart’s position
something something someting

1 Like

When i put the position like this :

local Character = player.Character
Character.HumanoidRootPart.CFrame = CFrame.new(-45.794, 3.461, 17.682)

it work . I think the part have a prob. But idk how to solve it

This might work
player.Character.PrimaryPart.CFrame = HidePart.CFrame

1 Like

Still not working … The player is still getting teleported under the map

1 Like

make sure to check if “HidePart” is anchored

2 Likes

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 .

1 Like

BROOO Omg am so dumb tnks you ! It was that…

1 Like

lol, no problem, it’s happened to me before as well.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.