How do I change paper2d animations from jumping to falling at the max height of the jump

I am having trouble with the logic for checking the apex of a jump, and then switching to the falling animation. Currently, I can get a jump animation to play at the start of a jump, but the player goes into a “falling” state even though he is still on the way up, which carries on until he lands on the ground again.

I am trying to play a looped animation for the entirety of the actual rise in jump velocity until the tip of the jump height… then on the way down, switch to another animation.

here is my blueprint as it stands

I read a similar post, and a solution would be to check the velocity on Z, and see whether it is positive or negative. does anybody know how to hook that up in blueprint?

Have you tried this ? UCharacterMovementComponent::IsFalling | Unreal Engine Documentation

I have a way around this issue.

How I jump:

http://puu.sh/hhseL/98a442b7e9.png

I use the premade function within the game.

How I set the Boolean variables:

http://puu.sh/hhsda/06097ac06b.png

For falling, I just use a premade function (again). It checks that, and it’s all good. But for jumping, I get my velocity, break it up into the Z vector, and compare that with 0.

How I set the flipbooks:

http://puu.sh/hhso6/dc4fbf5326.png

Pay attention to the order. If I didn’t have my jumping system setup, then “Falling” would be checked as “True” if I’m moving up or down because of the function I used to set the falling variable. To combat this, I have it setup to check if I’m jumping first. If my Z velocity isn’t positive, then it’ll check out as “false”, and it’ll set me to the falling animation (if I’m moving in the Z axis). The system essentially overwrites the check for falling to check if I’m moving up first, and if I’m not, then I’m moving down and it’ll set a falling animation.

I hope this helps.

PS: After review, I could probably redo the “Check if I’m falling” system by doing the same thing I did with jumping, but have the “greater than” float be replaced with a “lesser than” float (with the value still being 0). Although it’s possible that there would be an issue where if my Z velocity hits 0 right before I start falling, then I’d hit the idle (or run, but I’m not sure) animation before it got set to the falling animation. But what I have works fine, so I’ll probably just leave it as is until I need to do otherwise.

EDIT: Also, my animation state machine is created using an enumerator in conjunction with a function (no rhyme intended). So when you look at my “Animation State Machine” function, the “Animation State” setter that follows after the branches within it is an enumerator.

There is a solution that does not require the use of the Tick Event. The Character Movement component exposes a delegate in C++ that can be assigned to an event in Blueprint.

This only fires when the character enters the falling side of a jump or walks off a ledge.
Use the OnLanded event to clear the isFalling variable.

Be sure to enable the Notify Apex in Character Movement Component.

The following code snippet can be cut and pasted directly into blueprint to create the Bind and Event nodes. Attach the Event Begin Play to the Bind Event.

Begin Object Class=K2Node_AssignDelegate Name="K2Node_AssignDelegate_154" Begin Object Class=EdGraphPin Name="EdGraphPin_17783" End Object Begin Object Class=EdGraphPin Name="EdGraphPin_17782" End Object Begin Object Class=EdGraphPin Name="EdGraphPin_17781" End Object Begin Object Class=EdGraphPin Name="EdGraphPin_17780" End Object Begin Object Name="EdGraphPin_17783" PinName="Delegate" PinFriendlyName="Event" PinType=(PinCategory="delegate",PinSubCategoryMemberReference=(MemberParent=Package'"/Script/Engine"',MemberName="CharacterReachedApexSignature__DelegateSignature"),bIsReference=True,bIsConst=True) LinkedTo(0)=EdGraphPin'K2Node_CustomEvent_12.EdGraphPin_17784' End Object Begin Object Name="EdGraphPin_17782" PinName="self" PinFriendlyName="Target" PinType=(PinCategory="object",PinSubCategory="self") End Object Begin Object Name="EdGraphPin_17781" PinName="then" Direction=EGPD_Output PinType=(PinCategory="exec") End Object Begin Object Name="EdGraphPin_17780" PinName="execute" PinType=(PinCategory="exec") LinkedTo(0)=EdGraphPin'K2Node_CallFunction_10889.EdGraphPin_2389' End Object DelegateReference=(MemberName="OnReachedJumpApex",bSelfContext=True) Pins(0)=EdGraphPin'EdGraphPin_17780' Pins(1)=EdGraphPin'EdGraphPin_17781' Pins(2)=EdGraphPin'EdGraphPin_17782' Pins(3)=EdGraphPin'EdGraphPin_17783' NodePosX=336 NodePosY=-1168 NodeGuid=3DEC9E8B4A6B5869EED4D3BBDA8FC9A3 End Object Begin Object Class=K2Node_CustomEvent Name="K2Node_CustomEvent_12" Begin Object Class=EdGraphPin Name="EdGraphPin_17785" End Object Begin Object Class=EdGraphPin Name="EdGraphPin_17784" End Object Begin Object Name="EdGraphPin_17785" PinName="then" Direction=EGPD_Output PinType=(PinCategory="exec") LinkedTo(0)=EdGraphPin'K2Node_CallFunction_29117.EdGraphPin_17850' End Object Begin Object Name="EdGraphPin_17784" PinName="OutputDelegate" Direction=EGPD_Output PinType=(PinCategory="delegate",PinSubCategoryMemberReference=(MemberParent=BlueprintGeneratedClass'/Game/2DSideScrollerBP/Blueprints/2DSideScrollerCharacter.2DSideScrollerCharacter_C',MemberName="OnReachedJumpApex_Event_0",MemberGuid=86422A5C4EEF10C86FA68D8AE0509856)) LinkedTo(0)=EdGraphPin'K2Node_AssignDelegate_154.EdGraphPin_17783' End Object CustomFunctionName="OnReachedJumpApex_Event_0" Pins(0)=EdGraphPin'EdGraphPin_17784' Pins(1)=EdGraphPin'EdGraphPin_17785' NodePosX=224 NodePosY=-944 NodeGuid=86422A5C4EEF10C86FA68D8AE0509856 End Object

All works, but i have 1 problem “is Falling” doesnt works, so i must use velocity vector to define isFalling variable, can you tell me, whats problem in it?