I’m new on UE, I tried to find some answers but nothing found so I’d like your help!
I have an animal blueprint, it has different animations like idle, walk, eat; for the moment, the animal is doing some random animations between those.
I’d not do that. What I’d do is “If Deer is moving, then play the animation.”. And you can easily achieve this with State Machine.
To give you a macro concept:
Create a boolean variable in your Deer’s BP called Is Moving? and make sure its default is false.
Make it move, and as soon as it starts moving, set the Is Moving? variable to true.
When it stops moving, set the Is Moving? variable to false again.
In your State Machine’s Event Graph, you’ll be able to call a node called Try To Get Owner Pawn (or something like this). Just cast it to your Deer’s BP and assign the returned value to a variable with the same type of your Deer’s BP.
With this variable in hands, you can just add an animation to your State Machine and trigger it as soon as a given condition is true/false. In your case, you’d call the variable you just created to mimic the following behavior: When '[Character] Is Moving?' is true, trigger the 'Walk Animation', otherwise keeps playing the 'Idle' animation..
Fundamentally, this is the logic behind to make what you want. Alternatively, you can also blend animations to achieve (almost) the same result, but that’d require an extra effort.
To conclude my answer, I’ll leave the link to Epic’s State Machine Article once again because I think it’s a must-have in order to achieve what I’ve written. Here you go.
Thanks for your answer and your help, I learnt some things! I must say that even though I managed to do the state machine, I’m lost with other thing but I suppose I’ll manage on my own! I have more important features to do first.