Hello,
I am working on a firearm system and I have started working on playing the animations to the player.
It works by first playing a “draw” animation and then after that playing an idle animation.
However when I equip it only my arms animate and not my weapon, however when the idle animation kicks in the weapon gets animated and teleports.
This is my script:
function Shotgun:PlayAnimation(TrackName: string)
local animation: AnimationTrack? = self.Component:GetAnimations()[TrackName]
if animation then
animation:Play()
end
end
function Shotgun.new(Tool)
local self = setmetatable({}, Shotgun)
self.Component = require(script.Parent):FromInstance(Tool)
self.Tool = Tool
self.Trove = trove.new()
self:PlayAnimation("Draw")
task.delay(2, function()
self:PlayAnimation("Idle")
end)
return self
end
EDIT: I have tried changing the Animation priority to various priorities but it does not fix it.