Cannot get to play animations properly [SOLVED]

I’m checking if the character is moving, and if it is, it should play the running animation.
If it is not moving, then it should play idle animation.

However, it only plays the idle animation. I’m guessing the problem is at the start of the game, where character is not moving. Therefore, the animation is set to idle all the time. What am I doing wrong?

0 = idle
1 = running

Hi Wav and welcome.

As the beginning of the scene only happens once, you don’t need to have the Trigger once condition in that first event.

Your hero probably is changing animations but it’s too quick to see as you’ve asked it to happen one time only with your Trigger once condition. So take those conditions out and see if it helps.

Hi Bubble, thank you.

I’ve tried without Trigger once conditions before, but the result is still the same.

Ahhh. You’ve said when the hero is or is not moving using a Top down movement check. But you’re actually moving the hero with a force. Test it out with using the arrow keys and see if the animation changes.

So you could use the check under Movement with forces and check if the object is stopped (inverted) to get the move animation to work.

You are right, checking if the object is moving with forces does play both animations perfectly.

How would I bypass this problem if I just want to move the object towards mouse position?

Do you need the TopDown behavior? If you remove it from the Hero, is it going to make any difference? Will you ever be moving the hero with keyboard controls?

If the force system works then you could just keep using it. However I’m interested to know what others think as I’ve never actually used forces and don’t know whether they are an optimal method for character movement.

Solved the problem. I removed TopDown movement behavior (not sure if it was needed), but instead of checking if the Hero is moving, I checked if the speed of a Hero is greater than 0(moving) or if it is equal to 0 (not moving).

Thank you for the help!