x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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

alt text

Product Version: Not Selected
Tags:
jump difficulty.jpg (126.1 kB)
more ▼

asked Apr 14 '15 at 06:35 AM in Blueprint Scripting

avatar image

Adam Alim
1 1 2 3

avatar image Adam Alim Apr 14 '15 at 06:41 AM

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?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first
more ▼

answered Apr 15 '15 at 04:56 PM

avatar image

Ferret_228_
26 1 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I have a way around this issue.

How I jump: alt text I use the premade function within the game.

How I set the Boolean variables: alt text 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: alt text 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.

more ▼

answered Apr 17 '15 at 08:49 PM

avatar image

Anase Skyrider
16 1 3 5

avatar image Cornuell Jan 28 '16 at 11:20 PM

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?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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. alt text

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

onreachedapex.png (218.3 kB)
more ▼

answered Jun 03 '15 at 07:49 PM

avatar image

Strom
99 2 2 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question