Problem with 3d animation

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By rogerdv

Im trying to add an animated model to my scene, but Im not sure about how to do it properly. I exported the model from Blender, opened it as an scene in Godot, and set one of the available animations. It works while editing the model, but when I run the game scene with th model included, it remains static. Not sure if I forgot to add the right model (the scene, not the original DAE) or something. What could be wrong here?

:bust_in_silhouette: Reply From: johnygames

Not sure what situation you are facing, but I had problems with imported animations too.
What got it to work was the following:

  1. Go to the AnimationPlayer node. Enable the ‘Autoplay on load’ feature.

  2. Create a script for the AnimationPlayer node and put this line under the _ready() function:

func _ready():
	get_animation("default").set_loop(true)

Those steps will cause your animation to play on startup in a looping fashion.

Since you use blender, a more adavanced method of handling animations in Godot is by using the escn exporter. The docs are here:

and the exporter itself is here:

I cant find the Autoplay property in the AnimationPlayer.

rogerdv | 2019-12-30 13:59

Are you using Godot 3.1? If yes, it’s next to the selected animation. You have a few buttons(“play selected animation bacwards from current position”, “play selected animation bacwards from end” etc.), then you have the selected animation and then you have the autoplay on load feature.

autoload - Album on Imgur

johnygames | 2019-12-30 14:11

Im using 3.2, and I was looking in the wrong place. Will try again.

rogerdv | 2019-12-30 17:12