AnimationTree: Update parameter value automatically for Blendspace1D / Blendspace2D #9348
MatthiasBae
started this conversation in
2D
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the project you are working on
I am working on a TopDown 2D survival game where the characters might have a lot of animations based on the equipment, move direction, facing direction, injuries etc.
Describe the problem or limitation you are having in your project
The problem is that I have to maintain two different systems to change the current animation / state in the AnimationTree.
Advanced Expressions in Transitions to other states
Script to change the parameters for Blendspaces
example:
This makes it more complicated for complex AnimationTrees to change the animation as it will be changed by two different systems.
Also making changes to the AnimationTree results in updating every path which can be pretty tedious.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
As the Blendspace1D and Blendspace2D are also some kind of transitions it would be useful to also implement some kind of Advanced Expressions or you are able to reference a property of a script which the animator will check and update the blendposition to the properties value.
It would minimize the code the developer has to write and easier to maintain complex AnimationTrees because you do not have to maintain two different approaches / systems. Also updating the AnimationTree does not result in updating the paths in code.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
In Unity you are able to create variables in the Animator and assign them to BlendTrees. Depending on its value the Animator automatically changes the animation.
See the variable "Direction"
I would suggest some similar feature. Maybe it is possible to use the class which already will be used for the advanced expressions and make a reference on its properties.
Beta Was this translation helpful? Give feedback.
All reactions