How to play animation in 3D?

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

How to play animation of a 3D model in godot engine using GDScript.
Suppose I want to play walk animation of my character imported from Blender

Something like that,

player.animation.play("walk")

Is there anything like it?

Sure!

get_node(“AnimationPlayer”).play(“walk”)

Alex Pires | 2019-01-26 02:54

:bust_in_silhouette: Reply From: Zylann

I think when you import models with animations into Godot, they get imported as a scene with an AnimationPlayer in it. I guess you then have to get that node and use it to play animations, using the names you gave them.

If you don’t see any AnimationPlayer in the imported scene, maybe the format you used for your model doesn’t support them (like OBJ). If that’s the case, try another format like GLTF or Collada (DAE).

I’m not experienced in that area though, you could have a look at this doc explaining the whole workflow: Importing 3D Scenes — Godot Engine (3.0) documentation in English