Motor6D (C0, C1) Animation is not working well

I’m using Statue Animation by Motor6D (C0, C1) Animation
but, it’s not working well (sometimes working but sometimes not) I don’t know why

캡처.PNG
This Picture is a working reference

캡처2
This Picture is not a working reference

how do I fix this

local function Pose(Character)
	-- Head --
	Character.Head.Neck.C0 = Character.Head.Neck.C0 * CFrame.Angles(math.rad(15), math.rad(-20), 0)
	-- Right Arm --
	Character.RightUpperArm.RightShoulder.C0 = Character.RightUpperArm.RightShoulder.C0 * CFrame.Angles(math.rad(110), 0, math.rad(10))
	Character.RightLowerArm.RightElbow.C0 = Character.RightLowerArm.RightElbow.C0 * CFrame.Angles(math.rad(50), 0, 0)
	Character.RightHand.RightWrist.C0 = Character.RightHand.RightWrist.C0 * CFrame.Angles(math.rad(15), 0, math.rad(-5))
	Character.RightHand.RightWrist.C1 = Character.RightHand.RightWrist.C1 * CFrame.Angles(0, math.rad(2.5), 0)
	-- Left Arm --
	Character.LeftUpperArm.LeftShoulder.C0 = Character.LeftUpperArm.LeftShoulder.C0 * CFrame.Angles(math.rad(-25), math.rad(5), 0)
	Character.LeftLowerArm.LeftElbow.C0 = Character.LeftLowerArm.LeftElbow.C0 * CFrame.Angles(math.rad(10), math.rad(2.5), 0)
	Character.LeftHand.LeftWrist.C0 = Character.LeftHand.LeftWrist.C0 * CFrame.Angles(0, math.rad(5), 0)
	-- Right Leg --
	Character.RightUpperLeg.RightHip.C1 = Character.RightUpperLeg.RightHip.C1 * CFrame.Angles(math.rad(-20), 0, 0)
	Character.RightLowerLeg.RightKnee.C0 = Character.RightLowerLeg.RightKnee.C0 * CFrame.Angles(math.rad(-10), 0, 0)
	Character.RightFoot.RightAnkle.C0 = Character.RightFoot.RightAnkle.C0 * CFrame.Angles(math.rad(-10), 0, 0)
	-- Left Leg --
	Character.LeftUpperLeg.LeftHip.C0 = Character.LeftUpperLeg.LeftHip.C0 * CFrame.Angles(math.rad(-7.5), 0, 0)
	Character.LeftFoot.LeftAnkle.C0 = Character.LeftFoot.LeftAnkle.C0 * CFrame.Angles(math.rad(15), 0, 0)
end

and Statue is made by copy player character from game

2 Likes

very strange, try inserting a wait(1) at the beginning just to see if it works.

1 Like

Did you try using TweenService for this? I’m not sure if it will help, but it is worth a try, especially because it will allow some more customization of how the character gets to the pose.

Also, if you want the character to go into a specific pose then you should have the CFrame values the you are setting the JointInstance.C0 properties to pre-set. Otherwise the values generated when you run the function will change because they are being multiplied by the current value.
The way I would do this is by storing the CFrame values you want to set the C0 and C1 properties in tables and then looping through the tables and setting the values that way.

Also, just an extra tidbit of info, Roblox Lua supports compact operators to make your life easier while programming.
image
This means that instead of this

Character.RightHand.RightWrist.C1 = Character.RightHand.RightWrist.C1 * CFrame.Angles(0, math.rad(2.5), 0)

You could instead do this:

Character.RightHand.RightWrist.C1 *= CFrame.Angles(0, math.rad(2.5), 0)
1 Like

how do I use that with tween service

1 Like

I think it worked thanks for helping

1 Like

You should also test shortening the wait. Even though I know relying on waits for your script to work is absolutely terrible, sometimes a wait just kinda fixes it.

True, but usually if you rely on waits to fix something there may be something else wrong in your code. I usually stop what I’m doing and follow the flow of my code from the beginning up to the point where I would need to the wait to check for anything that might cause it. Usually I find something.

Unfortunately sometimes there just isn’t a visible issue with the code. I have recently had a problem with this regarding Motor6D, I couldn’t find a way to do it without a wait.

2 Likes

That’s true. I did say usually after all. Sometimes I can’t find an issue with the code and have to use a wait as well.