Playing animations has become an absolute nightmare now. Every time I try to create, load and play an animation on any local script, the animation doesn't run. Furthermore, when I use a script in the developer.roblox.com website it still doesn't work, but when I use the print function to test to see what is happening it shows that the animation has apparently played or something similar
developer.roblox.com script:
local Players = game:GetService("Players")
local character = Players.LocalPlayer.Character
if not character then
character = Players.LocalPlayer.CharacterAdded:Wait()
end
local humanoid = character:WaitForChild("Humanoid")
-- Create new 'Animation' instance
local kickAnimation = Instance.new("Animation")
-- Set its 'AnimationId' to the corresponding animation asset ID
kickAnimation.AnimationId = "rbxassetid://3532148210"
-- Load animation onto the humanoid
local kickAnimationTrack = humanoid:LoadAnimation(kickAnimation)
-- Play animation track
print("brah")
kickAnimationTrack:Play()
-- Connect 'KeyframeReached' event to a specific named keyframe
kickAnimationTrack.KeyframeReached:Connect(function(keyframeName)
print(keyframeName)
if keyframeName == "KickEnd" then
kickAnimationTrack:Play()
end
end)
my code inside a tool (tool is inside starter character and Is In the character when the game plays)
script.Parent.Activated:Connect(function()
print("Activated")
local humanoid = script.Parent.Parent:FindFirstChildWhichIsA("Humanoid")
local anim = script.Parent.Animation
local animtrack = humanoid:LoadAnimation(anim)
animtrack:Play()
end)
Any solutions? Others have told me that this code should work Thanks!

4 comments
Go in game settings and make the avatar mode R6
Thanks, this worked, from now on I am going to work on the game in R6. Is there a way of getting this to work in R15?
I think that MAYBE you should make the anim already there. Instead of Instance.new()
I will try that.