How to add jumping with "add force"

So I’ve finally been able to add forced movement to my 2d character (I’m making a platformer game), however this overrides any other actions I wish to execute, such as jumping. Why is this, and how can I fix it?

Would you please send a picture of how to do that? Or at least explain it? Thank you for the quick answer, by the way.

Oops sorry, should’ve done reply. “Would you please send a picture of how to do that? Or at least explain it? Thank you for the quick answer, by the way.”

If you want to jump, you’d probably want to use ‘Add Impulse.’ Impulse is a single force applied at once. Add force needs to be applied each tick and takes into account delta time.

As for the rest of your stuff, no idea.

I believe you’d use the ‘add impulse’ node on the actor’s root component. I’ve not done any of this in bp, though. I’m assuming you’re using paper2d with blueprints.

Yes, paper2d. I haven’t gone into c++ much at all, so I’m trying the forced movement with blueprints.

When I select it, it comes with the character movement attached to it. So do I cast to “2dsidescrollcharacter”?

When you select what? Screenshots are good.

If I were using a CastTo node, usually that’d be when I needed to access a variable stored in that BP for use in the one I was now working in. I’ve got some more to do here, but I’ll reply again after I finish lunch here and give you a better solution, with some screenshots of what I did. However, like TTaM mentioned, try and screen cap what you’ve done already that hasn’t worked and post that.

Sorry, I don’t know how to take a screenshot in UE4. I mean when I type in “add impulse”, and then click enter, it comes with the “add impulse” as well as the “character movement” thing attached. Where do I plug that into?

If you’re using windows or mac, go to http://puush.me, install their app and use ctrl+shift+4 to upload segments of your screen. It will put the link in your clipboard.

1 Like

Sounds good, I’ll see if I can get a screenshot.

Alright, TTaM and JYatesAccoridon, here is my screenshot. As you can wee, I have the character movement forced to the right, which is working great, I just can’t seem to get the jump action to work. I’ve tried both of the bottom sectoins, but I’m still unsure what to do. :slight_smile:

So the aim of the blueprint you’ve just shown is to force the character to walk to the right, constantly?

Yes, like the platformer example game, only 2d.

I also want to incorporate a “slide” and “jump”

And what happens if you hit jump?

With this current blueprint, absolutely nothing. I just keep running.

This was the only way that seemed to work for me regarding the constant running, but if you have another way that would comply with more actions such as jumping, please let me know! I just haven’t learned C++ yet, and that’s how they did the example.

Instead of the jump node, you coul dtry launch character with a z value of 100 or 1000, see what happens. And remove the stop jumping node. As for sliding, you could try the built in crouch method. You’d need to implement your own crouching animations and stuff, though.

Other than that, I think I’d need to get my hands on the project to see what was going on. That’s a bit beyond the scope of free help, though. :stuck_out_tongue: