Animation overwriting motor6D cframe?

I am working on this gun system, and I’m currently trying to add arms rotation so that the weapon aims where the player’s camera is looking, however it seems like the weapon holding animation is overwriting the motor6D cframe, because the rotation is just simply not applied, and there are only minor position differenes while doing a full Y axis camera rotation.

Here’s a clip of it happening:

This is a code I am running on every heartbeat to align the arms:

leftshoulder.C0 = CFrame.new(leftshoulder.C0.Position) * CFrame.Angles(workspace.CurrentCamera.CFrame.LookVector.Y, 0, 0)
rightshoulder.C0 = CFrame.new(rightshoulder.C0.Position) * CFrame.Angles(workspace.CurrentCamera.CFrame.LookVector.Y, 0, 0)

I’m used to working with R6 character rigs and never had this problem, however this is an R15 rig and I just don’t know what the cause/fix is.

I have tried running it on renderStepped just in case to try force the rotation just before the frame is rendered, but to no avail.

I’m also sure that there aren’t any other scripts conflicting in any way.

I’ve been stuck on this for some time now, I’d really appreaciate any tip.

Animations apply to the Motor6D.Transform property which is handled independently from C0/C1.

I’m unsure of how it fits into the C0/C1 solve but it multiplies onto one of them.

Transform is applied by the animator between the PreAnimation and PreSimulation steps. Transform can be written to as well so you do you.

1 Like

Thank you for the information, but that just makes me more confused on why setting the C0 is basically nullified/has no effect, I’ve also tried moving just the waist of the character instead of the arms, but while the upperTorso rotates somewhat normally, the arms just dislocate and stay in place instead of moving alongside the torso.

As @metatablecatmaid said use Motor6D.Transform instead of modifying C0, Transform allows you to apply transformations without being overwritten by animations.

That just seemingly has no effect, I think transform property is only to be used for describing the current offset caused by an animation. I tried setting the transform property on preAnimation, preRender and heartbeat just in case, but it doesn’t do absolutely anything

try setting Transform to CFrame.identity on PreRender, along with C0 = CFrame.new(C0.Position) * CFrame.Angles(workspace.CurrentCamera.CFrame.LookVector.Y, 0, 0)

I’m not sure if I’ve done what you meant, but after trying this:


unfortunately nothing at all happened.