What solutions have you tried so far? Did you look for solutions on the Developer Hub?
search animations tutorials
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
code:
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://7078009092"
script.Parent.Activated:Connect(function()
local Humanoid = script.Parent.Parent:WaitForChild("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")
local AnimationTrack = Animator:LoadAnimation(Animation)
AnimationTrack:Play()
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
Thank you very much! That solved it for me. I was just about to write a question, but then found this thread with the solution.
This seems a bit strange how these animations are handled compared to e.g.: images, meshes, sounds.
Some context for people who have this same issue later.
I made animations in editor and exported them with my account being logged in the editor for a game I am working on in team create enabled together with the owner of the game.
The animations work perfectly when I test them in editor, but if I test them online in the published game or even when testing from the editor with 2 clients, they don’t work anymore.
Thanks to @Unphases comment the owner exported the same animations and gave me the new IDs to use. With those, the animations work when playing the published game online, but now … and I think this part is funny … the animations don’t work anymore when I test them in editor.
This is different from adding images, sounds, meshes, etc. Those all work, no matter which account of the team-create group adds them to the particular game.
I was expecting animations to also work this way.
Maybe animations are not added to a game, so don’t become a part of an experience, but are separate from that?