godotengine / godotengine/godot-docs

Mention that you can access `AnimationNode`s through code

Open
#6,079 0 comments 0 reactions 0 assignees View on GitHub
area:manual enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**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 `AnimationNode`s 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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.