Character flops after Teleporting the character

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want my character to be able to teleport without flopping around at the end.

  2. What is the issue? Include screenshots / videos if possible!

https://gyazo.com/d96c0bf75d6d00e2af287129c6cde426

It seems like the hrp orientation somehow isnt upright although my animation shouldnt affect the hrp in any way?
Might be because during the teleport happening the Character isnt upright in the animation

  1. What solutions have you tried so far? Did you look for solutions on the Creator Hub?
    ive tried making the hrp upright while doing the teleport or after the animation ends but no success

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

-- Before the animation starts (upright, default idle)
local currentRotation = hrp.CFrame - hrp.CFrame.Position

---------------------------------------------------------
local ignoreList = {workspace.Entities, workspace.FX}
local teleportDistance = 50
			
local direction = hrp.CFrame.LookVector * teleportDistance

local ray = Ray.new(origin, direction)
local hitPart, hitPosition = workspace:FindPartOnRayWithIgnoreList(ray, ignoreList)

local targetPosition = origin + direction

if hitPart and hitPart.CanCollide then
	targetPosition = hitPosition
end
			
char:PivotTo(CFrame.new(targetPosition) * currentRotation * CFrame.new(0, 10, 0))

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

HumanoidRootPart rotation (or up vector) becomes misaligned mid-animation possibly.
Trying a few forced band-aids.

char:PivotTo(CFrame.new(targetPosition) * CFrame.Angles(0, hrp.Orientation.Y * math.pi/180, 0) * CFrame.new(0, 10, 0))

or with facing..

char:PivotTo(CFrame.lookAt(targetPosition + Vector3.new(0, 10, 0), targetPosition + hrp.CFrame.LookVector * 10, Vector3.yAxis))

Or you can bypass the animation effects and force the HRP upright during teleport.

local targetCFrame = CFrame.lookAt(
    targetPosition + Vector3.new(0, 5, 0),
    targetPosition + hrp.CFrame.LookVector * 10,
    Vector3.yAxis
)
char:PivotTo(targetCFrame)

I had a big problem with this when getting out of a tank.. due to locking off jumping.
I tried so many things.. this fixed it.

character:PivotTo(hatch.CFrame*CFrame.new(0,3,0))
humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
1 Like

okay i just tried all stuff i thought of and just fixed it by simply setting the CFrame of the hrp instead of using pivotTo or primarypartcframe and that worked

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.