I am currently messing around with animations and I'm running into an issue I can't seem to get around...
The animation plays correctly the first time when the character has existed prior however, when the character dies and I want the animation the play once again, it does not happen. Does anyone have any suggestions to what I could try?
Thanks!
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.Character:wait()
local animation = character.Humanoid:WaitForChild("holdAnimation")
local playHoldAnimation = character.Humanoid:LoadAnimation(animation)
redGun = player.Backpack:WaitForChild("Red Laser Gun")
blueGun = player.Backpack:WaitForChild("Blue Laser Gun")
redGun.Equipped:connect(function()
print("fired")
playHoldAnimation:Play()
playHoldAnimation.KeyframeReached:connect(function(keyFrameName)
if keyFrameName == "here" then
playHoldAnimation.TimePosition = .25
end
end)
end)
redGun.Unequipped:connect(function()
playHoldAnimation:Stop()
end)

2 comments
It might not work because you change character, try to put the loadanimation inside the equipped event (the char too)
Unfortunately that did not work, but thank you for the suggestion! :)