I’m using CFrame.new() for a teleportation skill, whenever I cframe the humanoidrootpart
the player is forced to face the same direction. I tried positioning the humanoidrootpart bud that causes problems with the player being in a different place on their end.
1 Like
HumanoidRootPart.CFrame = CFrame.new(Thing.Position, HumanoidRootPart.CFrame.LookVector)
Please note this method is deprecated. (Won’t get updates.)
1 Like
I tried that already here is my script
if SecondsHeld > 3 then
BlinkDistance = 30
else
BlinkDistance = SecondsHeld * 15
end
print(BlinkDistance)
local BlinkRay = Ray.new(Character.HumanoidRootPart.Position, Character.HumanoidRootPart.CFrame.lookVector * Vector3.new(BlinkDistance, BlinkDistance, BlinkDistance))
local Hit, Pos = game.Workspace:FindPartOnRay(BlinkRay, Character, false)
BlinkEffects(Character, Pos)
Character.HumanoidRootPart.CFrame = CFrame.new(Pos)
1 Like
Try multiplying your position only CFrame, by the CFrame of the HumanoidRootPart minus the position.
Example:
Character.HumanoidRootPart.CFrame = CFrame.new(Pos) * (Character.HumanoidRootPart.CFrame - Character.HumanoidRootPart.Position)
2 Likes
Can you try this?
Character.HumanoidRootPart.CFrame = workspace.PartNameHere.CFrame
Hopefully you won’t turn.
Well, that all depends on the CFrame on the part.
If the parts CFrame is different to the HumanoidRootPart’s CFrame, then the character will turn, and ‘hoping’ that it won’t turn, won’t make a difference, unless coded right.
Great solution! You can actually remove the CFrame construction by doing:
(Character.HumanoidRootPart.CFrame - Character.HumanoidRootPart.Position) + Pos
4 Likes