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