[Solved]Fox jump again and again

I just made same code until to fox.cs and everyting was working good.
In this lecture, after made a code for fox.cs fox jump again and again.
I just found out the problem because of loop check box for jump state.
After I unchecked loop, fox was stop after jump and no more action.
In animator I can check fox state stayed at jump.
How could I change jump_trigger to false?
I stuck this issue and could not go any more.

In the animator, you need to make a transition arrow from the jump state back to walk (or idle or wherever it came from). You’ll want to make sure that the “has Exit Time” box is checkmarked.

thank you for you response. However I did it already as follow thie lecture. As I said I did it same as the lecture. I want to turn off jump trigger after pass the stone but it keep its state as true on jump at animator parameter.

The things is, triggers don’t really have a true or false state. They;re just things that happen.

So when the “Jump” trigger occurs, the transition into Jump happens. That’s it. There’s no true or false after that.

To leave that Jump state afterward, you must have another transition in the animator, from Jump to another state. When you click on that transition (the arrow pointing away), you can set an Exit Time or you can set other conditions (triggers, bools, etc.) to cause the transition.

Setting a new transition away from Jump with an Exit Time of 1 (and no other conditions) should result in the transition away from jump occurring after resolving the animation one time in the jump state.

You can’t change a trigger to true or false, because the trigger doesn’t keep track of that kind of information. It’s not like a switch that you turn on and off. It’s more like a button that you press.

Why is this problem marked as solved? Anthony’s explanation is not solving it. I know how the triggers work and as dalami0i exaplined it’s not the problem with using it, but there is something wrong with Unity. My guess is that the behaviour of SetTrigger somehow changed in Unity5.

A checklist of what I have in my app:

  • Fox jumps when collided with gravestone as expected
  • He passes the gravestone boxcollider completely (I checked if the jump gets triggered twice, but it isn’t)
  • He repeats jumping all the way until isAttacking is triggered. If I look at the animator parameters, the isJumping one is always checked after the initial jump.
  • For the jumping clip, I have Has Exit Time checked and 1 is set in Exit Time. No other conditions are set.

I’ve tried to google for it and found that there is a general fuss about this thing and people are doing lots of different things to prevent this. I’d appreciate a best way to be shown here or an alternative approach to be introduced.

Actually, after 2 minutes of thinking about it I’ve found a workaround. I’ve added an Animation Event at the end of my jumping animation which sets the isJumping trigger to false:

public void StopJumping() {
  	anim.SetBool("isJumping", false);
  }

Everything works fine now, but I’d like to hear from Ben what’s the best solution to this.

Privacy & Terms