I am trying to play an animation on a character. The animation in this code is of highest priority, but I still have other animations I want to play on the character. This animation only takes .5 seconds but after I play this, I am unable to play any other animations on the character. It appears that this function never ends because the print never prints. I don’t know if it is meant to be like that as I am quite unfamiliar with using animations.
function playAnimation(character)
local humanoid = character:FindFirstChildOfClass("Humanoid")
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://15180690681"
if humanoid then
-- need to use animation object for server access
local animator = humanoid:FindFirstChildOfClass("Animator")
if animator then
local animationTrack = animator:LoadAnimation(animation)
animationTrack:Play()
return animationTrack
end
end
print("animation ended")
end