Alright, will try now to do that now.
All animations were successfully loaded, but fire still not playing!
Alright, so this means this issue is not with the script itself, but the animation itself. This could be from properties or something else. I need you to send a screenshot of animation properties and then make sure the animation URL is correct and do basic checks to make sure its all good.
local fireanimURL = ¨InsertAnimationUrlHere¨
fireanim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(¨¨)
Use that and instead of using the current method, try to load the animation via the ROBLOX URL.
Do you want me to use the actual ROBLOX link, or the rbxassetid link?
Use the URL with this type of link, ¨"rbxassetid://00000". A web URL or asset URL will not work.
I tried, getting an Unable to cast value to Object
error.
Send your code again please. Its most likely due to the game trying to access something before it loaded. More detail: Unable to cast value to Object error?
local aimanim
local patrolanim
local fireanim
local aimurl = 'rbxassetid://5827230227'
local fireurl = 'rbxassetid://5827260451'
local patrolurl = 'rbxassetid://5827116608'
function animate()
aimanim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(aimurl)
fireanim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(fireurl)
patrolanim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(patrolurl)
end
tool.Equipped:Connect(function(mouse)
animate()
The index nil error is when it stops the animations on unequip. Top one is when is the LoadAnimation.
local aimanim = Instance.new(¨Animation¨)
aimanim.AnimationId = ¨rbxassetid://5827230227¨
local fireanim= Instance.new(¨Animation¨)
fireanim.AnimationId = rbxassetid://5827260451¨
local patrolanim = Instance.new(¨Animation¨)
patrolanim.AnimationId = ¨rbxassetid://5827116608¨
function animate()
aimanimTrack = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(aimanim)
fireanimTrack = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(fireanim)
patrolanimTrack = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(patrolanim)
end
tool.Equipped:Connect(function(mouse)
animate()
Use this code please.
aimanim is defined as Instance.new('Animation')
… Do you want me to change the :LoadAnimation()
to the animation instance?
Oops, I’m silly. Nevermind what I said.
I did it, still same trouble with the fire animation. I’m gonna try to look through the animation a bit more.
Alr, what exactly is the issue you are having right now?
The original one, fire animation simply not playing. No errors.
Are you playing the track? You must play the track for it to execute.
Yes, see embedded code below.
fireanimTrack:Play()
script.Parent.Parent.Remotes.Shoot:FireServer(cursor.Hit.Position)
fireanimTrack:Stop()
I switched the clicking event from Button1Down to tool.Activated, still no success.
Can you ensure that your animation is set to the Action Priority?
The aiming and resting animation are set to Movement. The fire animation is set to Action.
I just fully remade the animation, and its still not working. I’m baffled to why this isn’t working.