Help with playing animations on a custom rig/object

Hey, guys!

For the past few days, I’ve been working on a horror game with a flashlight system that I’m quite proud of. However, there’s been a small issue with it. I’ve been trying to play animations on my flashlight model (yes, I’ve added WeldConstraints and Motor6Ds to get it functioning in the animation editor). The animation plays PERFECTLY in the animation editor, however, it does NOT play at all in-game. I’m not sure what I’m doing wrong, I’m loading the animation onto the AnimationController’s Animator and playing the animation, yet it does not work.

Edit: Also, the “Script” instance under the Flashlight model served as a test to see if it would play, I have tried it with a LocalScript, yet it does not work.

Any help would be appreciated!

image

2 Likes

Can you show the script of playing the animation? Also what is the animation priority of it?

1 Like

There’s no animation priotity on the animation, as there aren’t any other animations playing. I will try applying an AnimationPriority to see if it works. Script-wise, I made this basic one just to try and see if it works, as loading into my game and waiting for the game to fully load is time consuming.

Edit: AnimationPriotity does not work or change anything.

--// test animation for flashlight model

local animator = script.Parent.AnimationController.Animator
local up = script.Up
local down = script.Down

local upAnim = animator:LoadAnimation(up)
local downAnim = animator:LoadAnimation(down)

while task.wait(2) do
	downAnim:Play()
	task.wait(downAnim.Length)

	print("running....")
	downAnim:Stop()
end
1 Like

Does it output “running”? Also are you the owner of the animation?

1 Like

Yes, I’m the owner of the animation, and yes, it does print “running” every couple of seconds. It clearly knows the animation exists, as it prints after the length of the animation has passed, but it isn’t playing… which is really weird.

Are the parts anchored?




The “Root” part is, all the other parts have anchored set to false.

Solution
Turns out, the script was stopping the animation before it even played, which is why it wouldn’t work. :smiling_face_with_tear:

Thanks for your help though!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.