Hello, I’m making a portal feature but when you go through you go back to the portal you went threw. Now I think the reason causing this is that I’m using the on touch event since I don’t think there’s anything else I can use. I use a debounce but it still doesn’t work, I need help thanks. Video to show better teleporting spam - YouTube
Code:
local db = false
script.Parent.Touched:Connect(function(hit)
local hum = hit.parent:FindFirstChildOfClass(“Humanoid”)
if hum and db == false then
db = true
local velocity = hit.Parent:FindFirstChild(“HumanoidRootPart”)
hit.Parent.HumanoidRootPart.CFrame = CFrame.new(workspace[“Portal2”].Position + workspace[“Portal2”].CFrame.LookVector)
wait(1)
db = false
end
end)
Now actually I have a question, once I go threw the character faces away from the portal, how would I rotate the camera as well, because its going to be in first person.