well, that wouldn’t change anything, since it’s outside the function you can use it anywhere inside the script
Can you show us the path to the animation, where it is located? The script is pretty vague on that, maybe that’s the issue.
Are you making a new animation by using Instance.new()? Try doing that inside the function or putting the animation variable inside the function
Yea honestly you shouldn’t be playing animations on the server. The preferred way is to do it on the client, and where the animation is located might have an effect on playing the animation.
So should I use Instance.new(), on the client side?
Yes or just create an already existing one inside the LocalScript and load that
So I’m guessing outside the function it goes like:
local anim = script.Parent:WaitForChild("Animations"):FindFirstChild("DeathBeamAnim")
Then after that do you fire the anim to the server and use it inside the function?
Still does not work, I’m playing it on the client now
Could you show us the script? 30char
wait just a sec, imma try using instance.new
what should the animation be parented to? to the script?
Yea you can do that, but if you’re using Instance.new() I don’t think animations even need a parent. Also make sure to put the AnimationId
For the animation ID make sure to use the rbxassetid://(numbers) format since you’re Instancing it. I don’t think it will auto-format it to that.
local deathBeamAnim = Instance.new("Animation")
deathBeamAnim.AnimationId = "rbxassetid://5181621053"
local deathBeamTrack = hum:LoadAnimation(deathBeamAnim)
deathBeamTrack.KeyframeReached:Connect(function(Start)
deathBeam:FireServer()
end)
Still does not work, and now the keyframereached event is not getting fired anymore
I think you should always strictly set a Parent for any instances regardless of what they are, try setting it to the script.Parent just to see.
local deathBeamAnim = Instance.new("Animation")
deathBeamAnim.AnimationId = "rbxassetid://5181621053"
deathBeamAnim.Parent = script
local deathBeamTrack = hum:LoadAnimation(deathBeamAnim)
deathBeamTrack:Play()
Just try this and see if this works
still doesn’t work (30 characters)
Ok then your animation is either r6 or r15 which is not compatible with your game. Second thing is the animation priority, set the priority in the animation editor.
Dude, I’m so freaking dumb, I had the game as R15 only, sorry for such a rookie mistake and thanks for the help!