Monster doesn't want to play animation

Hi there, I have a problem. I have a monster for my game, and, I have an animation for it of it going to the darkness, then deleting itself. But anything I’ve tried, nothing works. Doesn’t play the animation. There’s even no errors or warnings in the output. Here’s the script and my monster:


Here’s the code:

local animator = script.Parent.AnimationController.Animator
local db = false
local animationTrack = animator:LoadAnimation(script.Parent.AnimationController.anim1)
animationTrack.Priority = Enum.AnimationPriority.Action4

workspace:WaitForChild("BobToDarkAnimTrigger").Touched:Connect(function(hit)
	if db == true then return end
	if hit.Parent:FindFirstChild("Humanoid") then
		db = true
		animationTrack:Play()
	end
end)

oh this is a pretty simple issue, you must include this simple code below

animationTrack.IsLooping = true ;

that should fix it!

IsLooping is not a valid member of AnimationTrack “anim1”. I’ve tried:

animationTrack.Looped = true

Did not work either.

What version of roblox studio are you using?

0.700.0.7000935

30 chаracter limit limit

ah yes, you are one version behind
the IsLooping property was added this Thursday so you just need to update your game engine then it will work!

How do I update Roblox Studio manually?

1 Like

open the hamburger menu in the top right, lick setings and then check for updates at he very bottom
you should see a green dot and the text “The most recent version of roblox studio is downloading” it will take a minute or two and you are good to go.

edit: mispelling

Where’s hamburger menu and where’s “check for updates”?

The hamburger menu is the three dots. If you cant see the Check for updates you will have to do a fresh install of roblox studio since you cant menually update it. just download the exe and then run it and it will automatically download the latest version which will have the IsLooping property.

Wait, can you attach a screenshot of the whole your roblox studio, please? With Check For Updates button visible

Should I delete and then install Roblox Studio though?

thats what i would do i cant send any screenshots im on my phone at the moment

Oh, then, when you’ll be able to send the screenshot, send it here pls. I’ll check it tomorrow

Don’t listen to the replies of xDeltaXen. They are not factual.

Have you tried to use a print statement to make sure the ‘Play’ function is being called?

how? like, print(animationTrack:Play()) or what?

like, just before you call animationTrack:Play(), add a print (“before play”)

so…

	if hit.Parent:FindFirstChild("Humanoid") then
		db = true
          print("before play")
		animationTrack:Play()
	end

if you see the ‘before play’ message, it means you have actually reached that line of code , which means the play function is being called, so we can rule out that you are not getting to that line of code

1 Like

yeah It says “before play” in the output

Let me set up a little npc, and put in your code and see what might be going wrong.