Gun animation not playing

I’m trying to animate guns for an FPS project I’m doing but I can’t seem to get the animation for my gun to work. The arms work fine, but my guess is that I am setting up the Motor6D to connect the arms and gun incorrectly.

In-game

Animation editor


Main part of script

animate.rigWeapon = function(self, model)
    self.weaponToCam = g.misc:newInstance("Motor6D", {
        Name = "weaponToArms";
        Part0 = model.synRoot;
        Part1 = g.viewModel.HumanoidRootPart;
        Parent = g.viewModel.HumanoidRootPart;
    })
end

animate.equip = function(self, tool)
    g.player.CameraMode = Enum.CameraMode.LockFirstPerson
    
    --// Weapon
    self.weaponModel = game:GetService("ReplicatedStorage").Engine1.Weapons[tool.Name]:Clone()
    self:rigWeapon(self.weaponModel)
    self.weaponModel.Parent = g.viewModel
    
    --// Animate
    self.animations = {}
    
    for i, v in next, require(tool.Config).animations do
        self.animations[i] = g.viewModel.AnimationController:LoadAnimation(g.misc:newInstance("Animation", {
            Name = i;
            AnimationId = "rbxassetid://"..v;
            Parent = self.weaponModel.Handle;
        }))
    end
    
    self.animations.idle:Play()

Explorer
image

2 Likes

i know what is happening dont create the motor6D in a script just in the animator gun rig dont remove anything just copy and paste it then put it as your gun model/view model

2 Likes

Alright I’ll try that
(i need more chars)

1 Like

Thanks, that works :slight_smile:

Too bad you can’t do it through a script though

1 Like