You can write your topic however you want, but you need to answer these questions:
-
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. -
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
- 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.