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"

Character Movement Issue

I am having issues with my character's jump and landing. Almost every time I jump, and land, the character will half jump and land again. Is there a way I can solve this problem? I am using the Animation Starter Pack. Thanks

Product Version: UE 4.16
Tags:
more ▼

asked Jan 16 '18 at 05:39 AM in Blueprint Scripting

avatar image

NuHabitStudios
46 4 7 7

avatar image NuHabitStudios Jan 16 '18 at 06:26 AM

Here is a link to a video to show you what I mean.

https://youtu.be/Vybj8-15zFU

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

1 answer: sort voted first

Unfortunately, it's hard to tell from your description. A wild guess: it could be that one or more of the transition animations are looping. Jump-start and jump-end should not loop.

If that isn't the problem, can you describe more, show your code/blueprints, and/or provide a video of the problem?

more ▼

answered Jan 16 '18 at 06:01 AM

avatar image

Jin_VE
4.4k 32 79 42

avatar image NuHabitStudios Jan 16 '18 at 06:17 AM

How do I know if they are looping? Where can I find that?

avatar image Jin_VE Jan 16 '18 at 06:28 AM

In your AnimBP, within the state machine. The jump-start and jump-end states have the animations inside. But if you don't know that then the problem is probably something else. Still, most times those are set to loop and it's not proper so it can't hurt to check it in any case.

avatar image NuHabitStudios Jan 16 '18 at 06:46 AM

So I only found one and unchecked it, but still same problem.

alt text

alt text

help1fw.png (215.9 kB)
help2fw.png (426.8 kB)
avatar image Jin_VE Jan 16 '18 at 06:50 AM

Only one state for jump? Well, that's not the problem. Show me the transition rules between Idle and Jump (double-click the two white circles with blackhorizontal arrows inside).

avatar image NuHabitStudios Jan 16 '18 at 06:54 AM

alt text

help3fw.png (254.7 kB)
avatar image Jin_VE Jan 16 '18 at 07:05 AM

OK. This time, just click on the transition from Jump to Idle. In the details panel, scroll to the bottom. There are three settings under "Animation State". In the one labeled "Left State Event", enter the name FinishedJump. This creates a notification called "FinishedJump". Now, go into the event graph of the anim BP and right-click. Enter the name "FinishedJump" and select the FinishedJump event. It will add an event node to the event graph. Drag off that execution pin and type "SetEnableJump" to create a set node. You want it to be false.

Now when the jump animation finishes, it will turn off the EnableJump bool and it won't re-enter the jump state.

avatar image Jin_VE Jan 16 '18 at 07:08 AM

Oh, and if you're turning EnableJump off anywhere else, don't do that anymore. If you need to know the jump is complete in the character BP then you can create a function in that and call it from the FinishedJump event in the anim BP. Yeah, if you're passing EnableJump into the animBP from the character then you want FinishedJump to call the character's FinishhedJump function, where you would set the EnableJump in the character.

avatar image NuHabitStudios Jan 16 '18 at 02:54 PM

Okay, so I did what you said and added the FinishedJump and added it into the AnimBP, but still same issue.

alt text

help5fw.png (533.5 kB)
avatar image Jin_VE Jan 16 '18 at 05:19 PM
  1. I wouldn't combine my suggestion of using notifies with the existing Character jump functionality. I would do one or the other.

  2. Why all 3 notifies? You just need the one that gets triggered when the transition begins from Jump to Idle

  3. You don't need the Jump notify

  4. What's this "JumpButtonDown" variable?

  5. You are calling Jump from two places

Let's get it to work without the Character Jump system. Then you can decide which way you want to go.

First, make sure the FinishedJump event is getting triggered. If the EnableJump bool is false and the animation isn't looping then you shouldn't see the second jump issue.

avatar image NuHabitStudios Jan 16 '18 at 05:36 PM

Okay, so how would i go about breaking this down to a more usable script? I don't know why they add what they do, I usually don't need to mess with their scripts. Thanks

avatar image Jin_VE Jan 16 '18 at 05:40 PM

I guess the problem is that the side-scroller template doesn't have jump built in. You could start with the third person template and change the camera setup. BUt for the way you're doing it now, you should remove the Character-Jump calls and add a PrintString to the FinishedJump event so you can see if it's getting triggered.

avatar image Jin_VE Jan 16 '18 at 05:49 PM

Also, see what you can get out of this: https://docs.unrealengine.com/latest/INT/Engine/Animation/Persona/Debug/

You want to be able to see what the animation state machine is doing while the game is running. Watch the state change as you do things with the character. When you jump, see if it's going from Jump to Idle and back to Jump again.

avatar image Jin_VE Jan 16 '18 at 07:52 AM

By the way, Character has built-in jump functionality. You can check out the third person template for an example. What I described is how to get events from the state machine to affect functionality. It will stop your repeated jump issue, but it's also a little redundant given the existing jump mechanism.

avatar image NuHabitStudios Jan 16 '18 at 02:56 PM

Yes, and the first person too, as well as most of the templates. I am using the Sidescroller Template, I wouldn't assume to fix the templates Unreal provide. (meaning, why would they give us broken templates that we have to figure out how to fix on our own?)

avatar image NuHabitStudios Jan 16 '18 at 05:40 PM

Here is the Anim Graph In Whole.

alt text

help6fw.png (998.6 kB)
avatar image Jin_VE Jan 16 '18 at 05:50 PM

Don't do the CanJump Don't set EnableJump in there at all. You're setting it from the character BP on keypress. And as I said, get rid of the calls to Jump. Let's do this your way first. Or, like I also said, if you want the existing jump functionality, then start with the third person template and modify it to get the side-scroller camera (and restrict movement to a plane). That's probably easier than getting jump into the side-scroller template.

avatar image NuHabitStudios Jan 16 '18 at 06:11 PM

As I stated, I did not add or do any of this. This is factory in a sense. Only thing I changed or added was the Finished Jumping as you suggested. I understand I probably shouldn't add it like it is, but I am new in this type of BP.

When I remove all the enable jumps, the player jumps without animation of jump.

avatar image NuHabitStudios Jan 16 '18 at 06:17 PM

The more I mess with the jump, it seems it's a time in air issue. When I jump and turn, it jumps again, when I jump to a step(up) it jumps again. Not on run jump or stand jump.

avatar image NuHabitStudios Jan 16 '18 at 06:18 PM

Also, when I unhook Idle Notify and the Jog notify, it jumps twice every time.

avatar image Jin_VE Jan 16 '18 at 06:20 PM

OK. I just created a side-scroller template and I can jump fine. So if you see this issue then it's something that you changed.

avatar image NuHabitStudios Jan 16 '18 at 06:22 PM

Yes, I remember, I came here for help on getting the player to jump with the animation and was told to add the enable jump to the characterBP. besides that, they are identical. ???

avatar image NuHabitStudios Jan 16 '18 at 06:30 PM

Also, just wondering, did you add the Animation starter Pack as I stated initially? That is the jump anim you should be testing to compare to my situation, no offense. That one doesn't jump correct from the start and you will need to adjust it to just get the jump animation working.

avatar image Jin_VE Jan 16 '18 at 06:34 PM

Why wasn't the template jump functionality sufficient? That doesn't use the starter pack animations.

avatar image NuHabitStudios Jan 16 '18 at 06:35 PM

I needed a better jump with (holding gun)

avatar image Jin_VE Jan 16 '18 at 06:47 PM

But that's just an animation, that shouldn't affect the jump functionality. In the jump state, you replace the old jump animation node with a node for the new jump animation. Can you point me to the post where you were told to add EnableJump?

avatar image NuHabitStudios Jan 16 '18 at 06:53 PM

Yes, I will look in my profile to find it. Also, I opened another sidescroller and went through what I needed and figured this out. My own changes as you stated that caused this problem is this.

alt text

I made the jump animation the stand jump instead of the run jump, it looked bad. I looked better with the stand jump.

Now, is there any way to fix this to work or am I out of options for using the animation starter pack?

help7fw.png (252.6 kB)
avatar image Jin_VE Jan 16 '18 at 06:31 PM

Jump with the animation? What do you mean?

avatar image NuHabitStudios Jan 16 '18 at 06:33 PM

Its jump is a walking jump to start with, by coming here, someone suggested I add the Enable Jump to the Character BP to actually use the Jump Animation.

Or else as I said, while in air(jumping) it is walking.

avatar image NuHabitStudios Jan 16 '18 at 06:58 PM

Okay, here is the link, I see I might have got confused with what they were saying. not sure.

https://answers.unrealengine.com/questions/737178/ue4-herotpp-animation-issues-help.html

avatar image Jin_VE Jan 16 '18 at 07:07 PM

This is the way the animation graph state machine looks when the side-scroller template is generated alt text How did it turn into what you have now?

capture.png (58.4 kB)
avatar image Jin_VE Jan 16 '18 at 07:09 PM

Oh, the starter pack...

avatar image NuHabitStudios Jan 16 '18 at 07:16 PM

Yes the starter pack is what I am working with. I can fix it by returning it to the run jump or Jog to Jump anim, but that looks bad. I would prefer to have the stand to jump as run jump if possible. It just looks better. But as soon as I change it, the problem is back. It doesn't like using stand to jump over jog to jump. Can I get it to work some how?

avatar image Jin_VE Jan 16 '18 at 07:22 PM

OK I looked into it directly. The way the starter pack animation is set up, it's going to be a pain to get it to look right. I was able to get it to use the starter pack jump correctly, but the jump is just a single animation so it looks horrible. The way it started in the template, there are three states: jump-start, jump-loop, and jump-end. That way, you have an animation that jumps up, an animation that falls through the air, and an animation that lands. This is the right way to do it. If you need to have a rifle pose then you will need more than this one jump animation. Those are not in the starter pack. It just has single jump animations, which would look right for short jumps, but not long ones like in a platformer game.

So you have two options: first, you could use blending so you can use the template's jumping system but overwrite the upper body of the animation so you can add in the rifle-holding pose. That adds complications, like if you're jumping, his legs would move fine but his upper body would be stuck in that rifle-holding pose. It might not look great, but it's easy, and you can always get better animations later.

The other option is to get the better animations now. There are animation sets available on the marketplace as well as on Mixamo. Whichever you choose, getting all that to work will be its own endeavor. But there are lots of tutorials on how to import animations and "retarget" them to your skeleton. It's a confusing pain, but it will lead to the best results.

avatar image Jin_VE Jan 16 '18 at 07:30 PM

By the way, I got it to "work" (from the default template with anim starter pack added) by changing the character mesh to HERO_TPP and the animation to the associated animBP and then adding this to the event graph: alt text

With the long jumps, it's not going to be sufficient IMO, and it's pretty ugly. But that is, technically, "working".

capture.png (140.2 kB)
avatar image NuHabitStudios Jan 16 '18 at 07:38 PM

Well believe it or not, with having the stand to jump instead of jog to jump and doing it like you showed, enable jump "yes" AND enable jump "no" on the character fixed it. I only had yes.

avatar image Jin_VE Jan 16 '18 at 07:43 PM

Cool. Be sure to clean out all that stuff that was added. You don't want wasted CPU or to confuse yourself in the future...

Also, when you feel adventurous, check out how to get the three-stage jumping to work with an animation set that has rifle-holding. Good luck!

avatar image NuHabitStudios Jan 16 '18 at 07:48 PM

Thanks, ya, there is still a lot to learn with BP's sometimes it scrambles my brain. I will check out other options as you suggest, might take me time, I am a solo developer. lol Thanks once again.

(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