I’m trying to create something that would just roam around, but now I have bumped into an issue where my part would reset into orientation to 0,0,0, and I can’t find anyway to fix this.
Please help me
I’m trying to create something that would just roam around, but now I have bumped into an issue where my part would reset into orientation to 0,0,0, and I can’t find anyway to fix this.
Please help me
Sometimes this orientation problem happens because the HumanoidRootPart
is facing a different direction than the rest of the parts, because Humanoids
move in the front direction of the HumanoidRootPart
. Try rotating the rest of the model by 90 degrees until the movement matches.
Don’t use MoveTo, use PivotTo instead
There is only one part, and doing this has not fixed my problem
PivotTo does the exact same thing
how is your humanoid set up to work with just 1 part?
can you show the hierarchy of the thing you are wanting to move around?
Using PivotTo((CFrame) * CFrame.fromEulerAnglesXYZ(math.rad(x), math.rad(y), math.rad(z))
works.
This rotated the object, but as soon as it moved it reseted its rotation to 0,0,0
A cylinder that points straight up is actually rotated on the Z (I think, might be the X) axis by 90 degrees so that’s why it’s rotating. To fix, try making its HumanoidRootPart a normal rectangular part that is facing up with the correct size, then use a WeldConstraint (or Motor6D if you need to animate) or similar constraint/joint to preserve its rotation relative to the real root part.
Try looping the rotation sequence
game:GetService("RunService").Stepped:Connect(function()
PivotTo((currentCFrame) * CFrame.fromEulerAnglesXYZ(math.rad(x), math.rad(y), math.rad(z))
end)
-- movement code here
turn AutoRotate to false inside the humanoid
Making a separate part transparent, and welding my cylinder to it has worked. It no longer resets its orientation.
Thank you
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.