So, I’ve been working on my 2D platformer recently and I added a teleport feature that teleports you to a different part in the map. But the thing is, in studio, when you get teleported, the player is just fine. But when I get teleported in the actual game, the player get’s stuck.
There are no invisible walls and the controls I’m using are A and D. But I am getting a warning that I can’t click on saying: function: 0xd18362f69f5939c7
function Touch(hit)
script.Parent.TeleportScript.Disabled = true
wait(3)
if script.Parent.Locked == false and script.Parent.Parent:FindFirstChild("TeleportPad").Locked == false then script.Parent.Locked = time script.Parent.Parent:FindFirstChild("TeleportPad").Locked = false
local pos = script.Parent.Parent:FindFirstChild("TeleportPad")
hit.Parent:moveTo(workspace.TeleportPoint.Position) wait() script.Parent.Locked = false script.Parent.Parent:FindFirstChild("TeleportPad").Locked = false end end
script.Parent.Touched:Connect(Touch)
Ok. So I figured out about why this is happening. This is happening because the script that I was using for the teleport was old and out dated. So I rewrote the script so now it is up to date and the player is no longer getting stuck.