Motor6d CurrentAngle not Changing

Hello, I’ve been messing around with animations that use Motor6Ds and I ran into an issue with trying to change a Motor6D’s CurrentAngle value. I have a basic script that equips then unequips a sword, and the Motor6D changes Part0 and parent based on a marker in the animation. Before the animation runs, my weapon welds to my back perfectly fine. Once the equip animation starts and hits a certain marker, the Motor6D changes Part0 to the Right Arm. When the equip animation plays again and the weapon is unequipped, the Motor6D changes Part0 back to the torso. This works, but the CurrentAngle of the motor is changed to some value that is not 0, which makes the sword look welded wrong. Here’s a section of my code:

 --Weapon motors		
local weaponMotor = workerModule.createConnection(torso, torso, wepHold, cf(1.29086304, 2.28774834, 0.399882376, 0.48582688, 0.873950303, 0.0135400016, 0.872923017, -0.484351397, -0.058389008, -0.0444709659, 0.0401863307, -0.998202145), "Motor6D")
wep.Parent = char
weaponMotor.Name = "VanargandMotor"

local shieldMotor = workerModule.createConnection(torso, torso, shieldRoot, cf(0, 0, 0) * ca(0, 0, 0), "Motor6D")
shield.Parent = char
shieldMotor.Name = "ShieldMotor"

wait(4)

local equipAnim = script.Equip
local equipAnimTrack = hum:LoadAnimation(equipAnim)

equipAnimTrack:GetMarkerReachedSignal("Weld"):Connect(function()

     if weaponMotor.Parent == torso then
	    weaponMotor.Parent = rightArm
	    weaponMotor.Part0 = rightArm
	    weaponMotor.C0 = cf(0, -1, 0) * ca(0, rad(-90), 0)
     else
	    weaponMotor.Parent = torso
	    weaponMotor.Part0 = torso	
	    weaponMotor.C0 = cf(1.29086304, 2.28774834, 0.399882376, 0.48582688, 0.873950303, 0.0135400016, 0.872923017, -0.484351397, -0.058389008, -0.0444709659, 0.0401863307, -0.998202145)
     end
end)

wait(2)

equipAnimTrack:Play()

wait(3)

equipAnimTrack:Play()
equipAnimTrack.TimePosition = equipAnimTrack.Length
equipAnimTrack:AdjustSpeed(-1)

Here’s a quick video I set up that demonstrates my problem:

Before any animations play and the sword is initially welded, the CurrentAngle in the sword’s motor is 0, as seen here:

However, after the animation plays and the sword put back on the back, the CurrentAngle is different, as seen here:

I tried setting the CurrentAngle to 0 in the script and it didn’t work. I’m able to set it to 0 in studio though. I heard some buzz online that you cannot changed CurrentAngle in parts named “Right Arm”, “Torso”, and “Left Arm”, but I’m not sure that is true. If so, that seems very weird, and maybe there should be an option to set that kind of functionality. Any ideas on how to fix this problem is appreciated!

3 Likes

I figured out my problem. The MaxVelocity of the motor is 0. By setting the MaxVelocity to something not 0 (I would suggest 0.1 like the shoulder motors), the CurrentAngle will change to the DesiredAngle.

motor.MaxVelocity = 0.1
7 Likes

Doesn’t work at all for me. I’ve been having a problem for a while now and it’s not fixing, even if I do what this post says. I’m gonna keep toying around with it though.

1 Like

Same here. The only thing that affects the angle whatsoever is the size of Part1, which only fixes the angle if its perfectly cubed, which is obviously not what I want.