How to teleport a player slightly higher than original position

I’m not sure how to word the title, but this is what I don’t know how to do
Let’s say we are teleporting a character to a position

local Name = "Luna_Adair"
local Pos1 = game.Workspace.TestPart
local Character = game.Workspace:FindFirstChild(Name)
Character:PivotTo(CFrame.new(Pos1))

It teleports the player there, but what how can we teleport the block just slightly higher than the original position? Cause let’s say you got an anti exploit that teleports you back to your previous position, sometimes you can get stuck in a part or glitch out of the map due to collision.

How can be basically do this?

Concept: (lol ik its not good concept, idk how to do it though)

Character:PivotTo(CFrame.new(Pos1..+ 0.1)) 
1 Like

Have you tried Character:MoveTo()?

from the api reference: “If there are any obstructions where the model is to be moved to, such as Terrain or other BasePart, then the model will be moved up in the Y direction until there is nothing in the way.”

https://developer.roblox.com/en-us/api-reference/function/Model/MoveTo

3 Likes
  • vector3.new(0, 5, 0) — teleports 5 studs higher

If the teleport part is on the ground, maybe try using the character’s size and do some math?

This may be a stupid question but wouldn’t that teleport them to the 0, 5, 0 cords?

the terrain is the issue, I have a floating island and it tp’s me all the way below it

He actually meant + but markdown converted it into a bullet

When I tried MoveTo, it doesnt accept a part in workspace as a valid location
image

local Name = "Luna_Adair"
local Pos1 = game.Workspace.TestPart
local Character = game.Workspace:FindFirstChild(Name)
Character:PivotTo(Pos1.Position)

:MoveTo() accepts Vector3, not CFrame.

2 Likes

instead of

local Pos1 = game.Workspace.TestPart

try

local Pos1 = game.Workspace.TestPart.Position
1 Like

Use CFrame.Position or Part.Position then, instead.

local Name = "Luna_Adair"
local Pos1 = game.Workspace.TestPart
local Character = game.Workspace:WaitForChild(Name)

Character:PivotTo(Pos1.CFrame))

OR

local Name = "Luna_Adair"
local Pos1 = game.Workspace.TestPart
local Character = game.Workspace:WaitForChild(Name)

Character:MoveTo(Pos1.Position))
1 Like
  • means plus the position
2 Likes