✓ Accepted answer
When it comes to animation, there are a few things you must know.
- You must OWN the animation. This means you have exported it.
- Make sure the animation's PRIORITY is set to ACTION this will guarantee it to overlap Roblox's Default animations with some exceptions.
- Make sure you actually have the animation as an object.
- Make sure when you do
:LoadAnimation() it's being done on a Humanoid
Alright now that you know this and confirmed it here is your fixed script:
local plr = game.Players.LocalPlayer
local chr = plr.Character or plr.CharacterAdded:Wait()
local hum = chr:FindFirstChild("Humanoid")
local UIS = game:GetService('UserInputService')
UIS.InputBegan:Connect(function(input, IsTyping)
if IsTyping then return end
print("test")
if input.KeyCode == Enum.KeyCode.E and chr then
local emote = Instance.new('Animation')
emote.AnimationId = "rbxassetid://1977787384"
local LoadAnimation= hum:LoadAnimation(emote)
LoadAnimation:Play()
wait(3)
emote:Destroy()
end
end)
This should work if you happen to find a bug or error comment below. Anyway, I hope I helped.
Here is some information on Animations:
http://wiki.roblox.com/index.php?title=Animations
Best of luck to you and hope it's fixed!
6 comments
Is it the animation not playing or the whole function?
Animation not playing only.
Check output, are you sure you own the animation?
In output it may also say if the asset couldn't load because it's not yours or something
It is mine and also I own it.
This will not load after the first time you die, mind