My script teleports me on top of creation and not inside

So I’m rewriting an SCP (914) and I want it to teleport me to the other side at a certain point.
But for some reason it instead TP’s me on top of the chamber.


I tried being TP’ed lower so that I won’t end up on the roof. It didn’t work.
I will make the roof higher ONLY if nothing works because the older version didnt have that issue. (I didnt make the older version.)

If that changes anything. Inside the chambers there are 2 transparent Non Collidable Blocks. The first one TPs and the other one (The chamber where I am supposed to be teleported into) Applies things and stuff.
If you have any fixes then reply below!

2 Likes

Can you include the code you are using for teleportation? Are you using CFrame or just setting the position?

Im using the MoveTo() function with Vector3

In.Touched:Connect(function(plr)
	local human = plr.Parent:FindFirstChild("Humanoid")
	if human then
		plr.Parent:MoveTo(Vector3.new(2.985, 48.60, 1352.213))
	end

Try the following:

local yourPosition = Vector3.new(2.985, 48.60, 1352.213)

-- When you need to teleport them
player.Character:SetPrimaryPartCFrame(CFrame.new(yourPosition))
Or to fit with your current code
local yourPosition = Vector3.new(2.985, 48.60, 1352.213)
In.Touched:Connect(function(plr)
	local human = plr.Parent:FindFirstChild("Humanoid")
	if human then
		plr.Character:SetPrimaryPartCFrame(CFrame.new(yourPosition))
	end
end)
3 Likes

Instead of CFrame.new(Vector3.new(2.985, 48.60, 1352.213)) You can simply say CFrame.new(2.985, 48.60, 1352.213)

1 Like

Oop- my mistake, thanks.
(30 chars)

Actually for some reason without the Vector3 part it didn’t work.
Dont ask me how or why but it just didn’t. I guess lua felt like it today ¯_(ツ)_/¯.

It is just inefficient to make a CFrame by a Vector3, is just inneficient and time loss.