Issue with orientation of part after picking up

Hello,

I am animating a flag for a player to carry. I have gotten the animation to work perfectly in the animator, but the issue is, when the player picks up the flag, the orientation of the flag is incorrect. I suspect this is because the flag is sitting upright on a post rather than the original horizontal orientation in the animator; however, I could be wrong.

Here is a screenshot of the flag on the post:
image

Here is a screenshot of the animator:
image

Here is what happens in game:
image

Does anyone have any suggestions?

1 Like

Motor6ds have to be the same as the animator. Consequently, when creating them :Clone() the motor6ds from the animation rig. Also make sure there are no other animation interference and the model is the same as well.

Similar problem:

1 Like

I’ve taken a moment to glance through both of those. Here’s what I’ve done, feel free to correct me where I went wrong (no change in the results).

This is my rig without the animator editor selected:
image

This is the Motor6D in the rig:
image

I copied C0 and C1 from the Motor6D in the rig:
(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)

Flag Constructed (copied Motor6D from Rig and placed in flag manually):

self.Motor6D = self.Instance.FlagPole.FlagPoleMotor
self.Motor6D.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
self.Motor6D.C1 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)

Player grabs the flag:

self.Instance.HitBox.Anchored = false
self.Motor6D.Part0 = Character.RightHand
self.Motor6D.Enabled = true

Is the model of the flag the same?

Is it modeled like this or this? With the front face of the part in different direction?

or even this?

image

This will affect the Motor6D’s positioning math reference from Motor6D.Transform. It’s also pretty complex with the CParent referring to the part that is most closest the Root part.

Similar to a WeldJoint, an active Motor6D will rigidly hold its two parts such that:
PartParent.CFrame * CParent * Transform == PartChild.CFrame * Child

Typically Part0 is the one closest to the root part like Part0 = Torso, and Part1 = RightArm, use RigEdit as it’s great for visualization.

So it would be sort of like this
Part0.CFrame * C0 * Transform = part1.CFrame * C1

That’s a total of 5 CFrame transformation that could lead to your part orientation being wrong.

C0, and C1 depend on the Motor6D initial offsets, or changed due to script manual CFrame animation.

Transform CFrame, depend on animation the roblox animation is applying.

Part 0 is the character rig CFrame.

Part 1 is the model handle CFrame usually.

I figured it out… C1 was changing when the animator was live. When I tried to use the command line to copy that value, the animator would cancel and go back to the original position. I used Moon Animator which would maintain the animation, copied the new value, and that fixed my issue.

1 Like