godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

Mention that you can access `AnimationNode`s through code

Open Hiiamwilliam opened this issue 3 years ago • 0 comments

Your Godot version: 3.5.stable

Issue description: The tutorial "Animation > Using AnimationTree > Controlling from code" only mentions how to, through code, access and control properties of the AnimationTree (specifically when the AnimationRootNode is an AnimationNodeBlendTree). However, it doesn't mention it's possible to access and control, through code, the properties of any AnimationNode - but you need to get the path to those nodes first.

This lack of information is problematic since you need to jump between different classes related to AnimationNode to figure out. It's not straightforward. People asked about this all around:

  1. https://godotforums.org/d/21821-how-do-i-change-the-animation-of-an-animation-node-during-runtime
  2. https://stackoverflow.com/questions/71277996/how-to-change-the-xfade-on-a-transition-node-in-script
  3. People thinking virtual methods such as AnimationNode.get_child_by_name are the answer, because if you follow the class reference on AnimationTree.tree_root it gives AnimationNode.

I propose adding a new... uh, subtitle?, maybe at the end of the "Using AnimationTree" tutorial, mentioning how to reference AnimationNodes through code. I suppose this isn't exactly a common problem, but I thought to log an issue anyway.

URL to the documentation page (if already existing): https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html

Hiiamwilliam avatar Aug 15 '22 19:08 Hiiamwilliam