How to make a character bounce off of a wall after jumping (I.E. Jump King)

I’ve been using Unreal for previsualization projects but just got into game dev stuff as a side hobby so excuse me if the answer to this question is painfully obvious. With that said, I’ve run into an issue that I’m 90% sure is a really easy fix since the movement I’m trying to emulate is very simple.

Basically, I want to make a 2D Jump King clone. I’ve got my character doing all the other required movements already. The one I’m stuck on is that I want to have my character jump, and when they hit a wall their velocity is mirrored and they’re thrown up and away from the wall before falling back down.

I’m attaching some Jump King gameplay so you can get an idea of the movement I’m looking for.

I’m a bit stuck as most tutorials about wall collisions are talking about wall jumping and that’s not what I’m looking for. Any help would be greatly appreciated!

Cheers!~

I also just noticed that my character can infinitely jump because I’m using the “launch character” node (I couldn’t figure out how to get lateral movement imparted from a stationary character), any ideas on how to fix that so it locks all control until the character lands?

There is a Disable Input Node that you could use to temporarily disable the player’s input until you land. (Bool it with a isFalling Boolean or something).

Here is also a thread that tries to achieve your problem. Maybe the solution can be found there?

My first instinct would be to get a Linetrace based solution. Basically, create a linetrace into my bounce direction and apply some force. This should push you into the right direction.

1 Like

Alright! I figured out how to get my infinite jumping to stop.

The thread above about wall bumping is perfect for a game in zero gravity, but for a game with gravity, it treats every surface as a place for the bump to occur and leaves my character high-speed bouncing around the level. I need it to occur only when the player bumps a wall while jumping (they also rebound off of walls when walking into them. Is there any way to differentiate between a floor and a wall in paper2d?

You can tag your sprites differently. Or if you want to dive deeper into blueprints and classes, try interfaces.

I had noticed that a lot of people were using tags in tutorials with wall jumping. My issue now is that I don’t see anywhere to add tags to pieces of my tileset to differentiate between floor tiles and wall tiles.

I overcomplicated the problem in my head. Here’s the solution I came up with that gives the effect I was looking for! I’m sure there’s a cleaner way to do it, but I’ve been using Blueprints for all of a few days so I’m not aware of a better way. :joy:

1 Like

I am pretty blueprint/coding illiterate and im trying to learn, I made this in a new third person project with no compiling errors and nothing is happening, would you go about making this differently in 3d or something?

I’m like 90% sure handling this in 3D is different, by at least some degree.

@Taliare - I’m playing around with a jumping game but haven’t really been able to replica the Jump King jumps. Would you be so kind to share your blueprint so I can learn from it? Thanks!