Skip to content

07. Creating compact graphs with JumpNodes

David Parra edited this page Jan 16, 2026 · 1 revision

We’ve used the state machine to drive the animations of our character in a standard way, the features we’ve seen up until now are shared with the default behavior from the state machines present on the Engine’s AnimationBlueprints, but there are some 2D specific features that we can use to make 2D development easier and more manageable, and to overcome hurdles that come with the nature of frame by frame animations like Paper2D flipbooks are.

We will learn about these features while continuing the development of our character, by adding a Jump functionality to it, first we’ll want to make sure our Character can jump, for that we’ve already added the needed code in the previous chapter.

Imagine having a very big animation state machine driving your character, and you want to add airborne animations to it. Airborne animations can happen at almost any state, and if the animation graph is big enough, this would mean you need to create a connection from every state to an Airborne state if you wanted to keep the behavior on the same graph. While it is true that there are multiple ways to implement the jumping (like creating a separate state machine for it, and then switching between them on the root animation graph), we’ll approach this by implementing the **Jump **functionality on the same graph, as a matter of example.

PaperZD comes with JumpNodes, which are “shortcut” nodes that you can put wherever in your state machine that can be triggered by code to force the state machine to go to said node. These nodes are useful for interrupting the state machine usual flow for things like being damaged or, like in this case, jumping or being airborne, while still keeping the logic inside the same state machine.

We’ll first create the logic of our Airborne states, for this we’ll first create a JumpNode called Airborne, the name is important as it is the identifier used for later triggering said jump.

Add a JumpNode by simply right clicking and adding a node as you would do a state or a conduit, then change the name to Airborne.

54_Creating-compact-graphs-with-Jump-Nodes

55_Creating-compact-graphs-with-Jump-Nodes

After that we want to create the jumping logic: When starting a jump (or being airborne) we’ll first run the Jump animation (even though we could have just fallen), we’ll explain this after the base logic is completed.

After Jumping, one would start falling (after the apex completes), we’ll add the Falling state. Passing from Jumping to Falling happens when the upwards velocity of the fall becomes negative (meaning we are falling and not going up). Finally we reach the grounded states, either Walking or Idle, we’ll connect to Walking, as it’s more likely we’ll be moving and not perfectly still, but this could change depending on how the landing logic works in a game.

56_Creating-compact-graphs-with-Jump-Nodes

We’ll also put the Jumping and Falling animations in their respective states, making sure the Play Animation Nodes are set to not loop, as these animations were made with this in mind.

57_Creating-compact-graphs-with-Jump-Nodes

Inside the link between Jumping to Falling:

58_Creating-compact-graphs-with-Jump-Nodes

And inside the link between Falling to Walking:

59_Creating-compact-graphs-with-Jump-Nodes

By default, AnimationBlueprints have Allow Transitional States setting enabled on their class defaults. This makes the state machine continue evaluating the states until a stable one is found. In the example above, if your character falls (without jumping), the state machine will first evaluate the Jump state, and right away evaluate the transition and move to the Falling state, as the velocity is negative; the state machine would then stop there, as no other transitions are available and the Falling state would render, the Jump state won’t. The Jump state in this example becomes a transitional state, which helps create a more compact state machine, removing the need of extra connections by allowing the state machines to flow naturally to their stable state.

Now that the State machine is ready, we simply need to trigger the JumpNode by getting the AnimInstance that is stored on our AnimationComponent. As explained before the AnimInstance is the instance of the AnimationBlueprint we’re building and that it’s used to drive the animations of the component.

In our character’s blueprint we will add the following nodes, to detect Jump and Falling behavior, both of them will trigger the same JumpNode and the state machine will do the rest.

60_Creating-compact-graphs-with-Jump-Nodes

If you test now, the character will have a Jump/Fall animation setup, but it will have no intermediate animation and will look very stiff.

61_Creating-compact-graphs-with-Jump-Nodes

Clone this wiki locally