I want to use the anim state graph to transition a npc creatures from different animations.
(I made the models and animations)
For the life of me I can’t figure out how to do so, even after reading blog posts and the API.
The issue I am dealing with is maybe the trigger? I have the start to idle, and idle to walk, and walk back to idle seen below.
I ended up scrapping my code out of frustration, but if anyone could help me I would be so thankful. Right now its more for aesthetic purposes (I don’t want the creatures to walk while in an idle state like the video below)
Did you give the transitions between your states a condition? The transition from one state to another state will only occur if those conditions are met.
You can change the values of the conditions by script, for example when the character start to move, so the anim state graph can execute the correct state based on the conditions of the transitions.
thank you! I do still have some questions.
The tutorial said to add a parameter and set to boolean, but the next screenshot shows the parameter with a different name and set as a trigger?
Okay so after following it so far I got it to blend the animations but both loop and and transition back and forth between each other, so this is progression. (here’s my state graph)
This is the script I am trying to use to make the animations change
(idle animation while the creature is idle and walk while the creature is walking or turning)
So, I didn’t have the boolean set right, and idle was active while walking was, I had to change it so when walking isn’t active idle is true. such a silly mistake.
Thank you for helping me understand how to do the animation using a state graph, Now I can do a lot more (since I make animations, I could use it to animate a door or a NPC player or a melee attack.) This is awesome
I’m a little confused about the image below. I thought the first arrow will display the value of the second arrow, but in your case they are different. How did you do this?
To be honest, I have no clue. I was working on the state graph all last night searching for documentation on how to set it up properly, I guess it’s maybe how I set it up last night, since today I redid a lot in the graph. I’m also very new to the state graph system, so I’m not 100% sure what I am doing. (side note: sometimes the things that display on my computer are different for other users? For example I tested the walking speed of the creatures on my PC and it looked fine, but on another they went lightspeed, so maybe this is the same case? Or I may be connecting uncorrelated things.)
Yeah that makes sense, my editor is always bugging out for some reason or another, and yeah I thought the same so I’m doing that now. By the way I appreciate your time and help.
I have the animations for these ones, just an idle and a walking animation, I’m going to add a sleep animation and dying animation (they will sleep at night, and have a decay where they will eventually die) but if you want to for the fun of it or you do the animations (or export them with bones, or in a way I could animate them) Id be happy for you to! It’s all up to you though, and I’m not sure what I’ll be adding next.