How to make walking animations stop when character is jumping

I am having a problem with my character’s walking animation playing in mid-air when he jumps. Is there some way to make the walking animation stop when the character is not touching the ground?

what about the collision or touch sensor?

Would i connect the collision sensor to the controllers and actuators of the walking animation?

Also, how can i have my character’s idle animation play only when he stops?

Yes, you would connect the idle animation to a Collision sensor set to collide with objects of whatever type your ground object is (it has to have a variable, like ‘ground’, and you use that in the Collision sensor). You do the same with the jumping animation, but I think you would invert the attached Collision sensor (the Inv button).

When I did that the animation didn’t play. I added a collision sensor to the idle animation and gave the ground the property “floor” and entered it in the collision sensor, but nothing happened.

You should not care collisions at this stage.

You need to implement a FSM - finite state maschine - to control the animation flow. You can use the logic blocks states for that.
Simply have one state for each animation you want (idle, walk, jump, run etc).

State or Entry action:
When you enter the state you start playing the animation of the state -that’s all.You can use the action actuator for that.

Transition
The FSM part is to define the transitions between the states. e.g. on collision, on key press, on mouse move.
For that you have all sensors plus the state actuator.

BTW: Do not forget to set the initial state :wink:

hope it helps
Monster