When I try to set the Motor6D of a part on the character for a gun system, it starts randomly spinning. The speed of this spin is correlated to the angle I give it in CFrame.Angles
Interesting, I’m just a bit confused as how that would be the case. Usually when a character turns into a perpetual motion machine, it’s because a Motor6D’s CFrame is being set inside some kind of loop incorrectly. From that code, it appears you just set it once?
Furthermore, if that’s the case, does the character’s arm still spin if you disable the default animation script inside of the character? The goal of disabling the Animate script is to isolate the problem and make sure the problem occurs on its own, without animations being active on the character’s rig.
No, not really, think of it like a dog chasing their tail; the dog is never getting closer to their tail which each spin. This behavior is expected when you setup the IK incorrectly.
What was incorrect about the IK setup?
The IK Target, (the gun’s handle part), was rigidly attached to a body part somewhere between the ChainRoot and the EndEffector, so when the character’s hand moved, so did the Target. This means the IK made zero progress towards its goal with every IK iteration, resulting in a perpetual motion machine.