• Tutorials
  • (Beginner 3D Character) Plays random animation during Idling

Hey, sharing what I learned. For when you want your character to play some animations randomly during idling, like these.

https://github.com/j3du/Random_Idle_Animation_3D

What it does -A Base idling animation will play at the start -After Timer count down 6 seconds AND it finds Base idling animation is playing -A random "gesture" animation will play instead -When Gesture animation ends it will go back to Base idling animation and restart Timer countdown

Notes -This demo only shows the animations (no movement or nothing else). -It has no animation blending so animation will abruptly change (for this demo, I carefully keyframed it to look smooth). -You can change the wait time or have more gesture animations. -Set Base idling animation to loop and gesture animations to no loop.

You will probably need some basic understanding of these -Export/Import a 3D character animations to Godot -Timer node -Signal

If anyone finds I make mistake, or has other/better method, please feel free to share here :)

@Gowydot said:

-It has no animation blending so animation will abruptly change (for this demo, I carefully keyframed it to look smooth).

You could probably use the AnimationPlayer queue() method to avoid that and let the current animation finish playing before the next queued animation starts playing. And you can use get_queue() to retrieve an array of the queued animations to check for duplicates.