I am trying to create a seamless teleport. Basically, I’ve made an elevator, but instead of the elevator actually moving up, it’s just gonna teleport the player to the next floors elevator, and then open the doors. So I’m trying to make the teleport unoticeable.
At the moment, this is what I got
local character = player.Character or player.CharacterAdded:Wait()
character:MoveTo(teleport.Position)
It all works, teleport is the part inside the floors elevator. However, when you do teleport, your characters facing position, etc. changes randomly. Is there anyway to get them to teleport facing the exact same way to thus create the seamless effect of teleporting
Therefor you would input input your Vector3 position (What you were using originally to move the character, teleport.Position)
And the lookVector, another Vector3
local character = player.Character or player.CharacterAdded:Wait()
local HumanoidRootPart = character:WaitForChild("HumanoidRootPart")
local lookVector = HumanoidRootPart.CFrame.lookVector
HumanoidRootPart.CFrame = CFrame.new(teleport.Position, lookVector)
It’s also good to mention that MoveTo accepts only one value, a Vector (unless the wiki is outdated)
this will teleport you to the position without sometimes putting you at the very top of the structure, and will retain the previous orientation of the character.
Still get the same problem. I can see what’s wrong but don’t know how to fix basically need to see the players position compared to the teleport part, and then teleport them to the next teleport part in the same position. Atm they just get teleported onto the exact position of the teleport part.
Description:
Returns a CFrame transformed from World to Object coordinates. Equivalent to CFrame:inverse() * cf
This function supports threading over its arguments, so you can plug in multiple CFrame values and have their transformations returned as a tuple.
local character = player.Character or player.CharacterAdded:Wait()
local currentPlatform = game:GetService("Workspace"):WaitForChild("ElevatorFloor1") -- The floor of the elevator you're currently in.
local goingPlatform = game:GetService("Workspace"):WaitForChild("ElevatorFloor2") -- The floor of the elevator you're going to
local offset = target.CFrame:toObjectSpace(character:WaitForChild("HumanoidRootPart").CFrame)
character:WaitForChild("HumanoidRootPart").CFrame = goingPlatform * offset