Hello, i’m working on a gun that when equpped makes arms and head move with mouse and this part worked pretty well:
But when i reload:
Here’s what it looks like in animation editor:
I think this happens because i set the m6d.c0 to
CFrame.new(0, -0.6, -0.1) * CFrame.Angles(math.rad(-90), 0, 0)
I made this so the gun keep sticked to the end of the arm.
I tried to remove the motor6d’s C0 when i play the animation and adding it again when the animation ends but this happens (At the end of the video) :
And it looks like this is not the right way to do this.
Here’s the function that plays the animation:
local function Recarregar(ReloadAnimation) CanAnimate = false ReloadAnimation:Play() ReloadAnimation.KeyframeReached:Wait() PlaySound:FireServer(script.Parent.Sounds.Reload) task.wait(ReloadAnimation.Length - 0.18) CanAnimate = true Ammo = MaxAmmo ChangeAmmoGui:Fire(Ammo, MaxAmmo) end
I made this gun “animable” with this tutorial and then scripted it, but in order to make the gun move with the arms i changed the motor6d’s part0 to right arm instead of torso, and this doesn’t caused any issue, but this way the gun only move to the hand if i play an animation:
And if i freeze the animation in order to keep the gun in the hand, the gun will, only if i keep the arms straight, otherwise the gun will float in the air.
Well, this problem is really specific so i don’t found any solutions in devforum or in internet.
If you have an idea of how to fix this or need more information about the problem let me know.