Rig not rotating correctly when animating

I made a rig, and I’m trying to animate it, but the “body” part in the the model isn’t rotating correctly. Instead of rotating the model, it rotates the plane it’s being animated in.

Rig:
image
Parts in workspace:
image
Plane rotation:


Also, when rotating the rock on the top, the rock stays fixed while the rest of the body rotates around it. The rock’s joints are as follows: Part0 = Body Part1 = Rock.
image

-- Insert the part you want to rotate
local partToRotate = workspace.Part -- Replace "Part" with the name of your part

-- Set the rotation speed (in degrees per second)
local rotationSpeed = 90 -- Adjust the speed as needed

-- Function to continuously rotate the part
local function rotatePart()
    while true do
        partToRotate.CFrame = partToRotate.CFrame * CFrame.Angles(0, math.rad(rotationSpeed), 0)
        wait(1/60) -- Adjust the wait time for smooth rotation
    end
end

-- Call the rotatePart function
rotatePart()

What does this code block do for the animation?

This is animation of the is script

This just spins it like a helicopter blade. I’m trying to make an animation in the timeline, not script rotations. I need to rotate the body to look around the world for the animation.

Are you an AI? Or am I just going crazy

No I am not Al It’s something wrong

My issue is dealing with how I rigged the model. It doesn’t have to do with scripts or anything.

Didn’t work this now anything run

Stop using ChatGPT and learn English as quickly as possible.

@MrMatthewGamingX, is your HumanoidRootPart anchored?

1 Like

No, it is not anchored. I have a feeling it has to do with the rock on top, since when I removed it, the body rotated correctly

I suggest to set your rig’s PrimaryPart to the HumanoidRootPart and anchor that while editing animations.

1 Like

Thank you! this worked out for me!

1 Like

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