[Blueprint] Wall Jump fail

Hi everibody! I’m here beause i have a problem and I hope you will help me :slight_smile:

So, i’m trying to make a 2.5D Game with the feature : Wall Jumping. I have tried this and i have that :

So, at the begining i said “You can jump two times!” The first is a normal jump, and the other one is a Wall jump :slight_smile:
Just after that you see “Ca c’est le mur” this is like a wall, in fact, this is when I press a button, I simulate a fake wall.
And after that, this is some test if you are jumping you can continuate and after that you have the direction of the wall.

So, the problem is, that is not what i realy want… And i don’t know to have it! Because when I simulate my fake wall, i’m jumping!

What I want is :
You are jumping first time, if you have a wall and if you are jumping a second time you do a wall jump! But i don’t have this
!
So if someone wants help me, it would be nice

Thanks a lot!

There are many ways to accomplish what you want,
First of all it’s important to note that the Do N starts to count at 1, so put your Switch on Int’s starting index to 1,
Secondly, don’t run that Do N in a function, a function is basically an Execute-and-Forget; it won’t keep track of the counter for you.
Use a Macro instead if you want to tidy up the blueprint.

I made an example for you here, consisting of a Character Blueprint, a Macro, and a Function.

To begin with I designed the Macro to check for double jump with the ability to reset it’s own counter,
Make a new Macro and name it MacroJump:


Then I went on to add the Detect Wall function using a simple Sphere Trace,
Make a new Function and name it DetectWall:


Then I put it all together in the MyCharacter blueprint like so:


You should be able to double jump when you hit a wall now,
do study the blueprints and please ask me if there are parts of the blueprint you don’t quite understand!

Hi!

Thanks a lot! It is super cool to try to help me, really :wink:
I thinks i have understood the algorithm, but it’s possible that i will come a second time ask you some details.
Thanks a lot!

It’s cool to see guys like you ready to help others, you’re a good guy :slight_smile:

Edit :

I know, as you can see in my screenshot ( in my first post ) i have made something "When you press your stick on the left the variable Left =1

I have made this to get the orientation of the Jump, but… It’s not the best idea… There is a function in Unreal Engine who can make it? Because the player won’t necessary press the left stick to wall jump on the right…

I also tried to make an infinite loop on the macro jump because, the player can jump as much as he wants as long as he is in the air so at the end of Launch Character i have take the “exec” and put on the “Switch on it” and i have a freeze…

I also have a bug, if I try to do a wall jump in the air when there is no wall the shpere is red and tells me “No, you can not do a wall jump” but if just after I try to touch the wall (I’m always in the air) and I jump, I fall and i go to ground, so why and how can i solve this problem?

Thanks a lot !

Yes that is possible, but unfortunately all the traces except for Line Traces are bugged and you’ll have to wait for Epic to fix that,
once it’s fixed all you have to do is get the impact point relative to your characters rotation.

Until Epic fixes the bug you can use Line Trace instead of Sphere/Capsule trace.

Indeed, the MacroJump is restricted to 2 jumps even if in the Air,
but that is really easy to change, like so:

http://imageupper.com/s02/1/5/M1398282975647616_1.png

All you need to do is to make a boolean variable called “WasInAir” and set it to the return value of DetectWall,
and you can also remove the “Recursive Reset” pin (optional)!

If you can’t wait for Epic to fix their trace bugs, you can use Line Traces instead,
this is not the best solution because you will need a line for every possible location/rotation if you want to do a 360 sweep.

Instead of making the blueprint very huge with a lot of line traces, we can trace Left and Right of the player position.

In the **DetectWall **function all we need to do is add a Line Trace node after the Single Sphere Trace
and output the information to the MacroJump, like so:

(It continues from the DetectWall blueprint I posted)

http://imageupper.com/s02/1/9/S1398287352641033_1.png

It uses 3 new variables, Hit Side (bool), Right (bool) and Amount (float).
When Hit Side is True it means that one of the Line Traces (left/right) hit a wall,
When Right is True it means we hit a wall on the Right, otherwise a wall on the Left.
**Amount ** is how far into the world we are tracing, if you want to trace further then increase the value.

Some modifications to the MacroJumps are also necessary:

http://imageupper.com/s02/1/9/S1398287352641033_2.png

There are now 4 possible jumps:

  • Normal jump
  • Wall jump (forward/backwards)
  • Wall jump (Right)
  • Wall jump (Left)

If you only want a Right/Left jump then wait for the next version of
Unreal Engine which hopefully has the Sphere/Capsule trace bug fixed :smiley:

Hi!

Thanks for your help!

I have try this, and this doesn’t work… I don’t know why…
I can jump only one time.

I have see in the debug mod ( Macro Jump) my jump never goes into the “Wall Jump (Right)” and the "Wall Jump (Left) i don’t know why.

This is my Blueprint script if you want to see.

This is my Event Graph

http://image…com/minis/2014/17/139833538-eventgrph.ng

This is my ** Detect Wall**

http://image…com/minis/2014/17/139343541-etecwall.pg

This is my Macro Jump

http://image…com/minis/2014/17/139343540-mcrjup.ng

I don’t know why this doesn’t work…

Hello, it looks almost correct except for the Wall Jump (Right) and Wall Jump (Left).
You are using Get Actor Up Vector, but should be using Get Actor Right Vector !

In Wall Jump (Right) : Get Actor **Right **Vector –> Multiply by -1000  ( character will launch itself to the left  )
In Wall Jump (Left)   : Get Actor **Right **Vector –> Multiply by 1000   ( character will launch itself to the right )

You can also get rid of the Recursive Reset like I did in my blueprint, it’s not needed for it to function properly because you can now jump multiple times,
Let me know if that helped :slight_smile:

It’s the same!

When I press Jump, i’m jumping that’s good.
But I can’t wall jump he considere that like just a normal jump and i can Wall Jump only one time!

Exactly the same problem, don’t know why…

Thanks again :slight_smile:

Oui! Do you want to be able to Wall Jump for an infinite amount of time?
The way it should work is like this:

  • 1 normal jump
  • 1 wall jump when you hit the wall ( but you have infinite retries to hit the wall )

do you perhaps want this? :

  • 1 normal jump
  • unlimited wall jumps

If you want, say 3 wall jumps max, then just add 2 outputs to the Switch on Int
and connect the pins to the DetectWall (same way as pin 2),
and also set the Do N to 4.
Like so:

http://imageupper.com/s02/1/2/N1398379841649837_1.png

If you want unlimited wall jumps then all you have to do is set the
**WasInAir **to always true after a wall jump,
like this:

http://imageupper.com/s02/1/2/N1398379841649837_2.png

:smiley: let me know if that is what you wanted!

I modified the **MacroJump **a little so that you can specify Max Wall Jumps or Unlimited Wall Jumps to make it easier to use.

In the Event Graph there are 2 new parameters, Max Wall Jumps and Unlimited Wall Jumps.

Set Max Wall Jumps to how many wall jumps you want,
or set Unlimited Wall Jumps to True and the blueprint will ignore the Max Wall Jumps.

Surely that should cover your needs.

If it doesn’t work as expected then there might be a bug somewhere in your blueprint
and I will send you my blueprint file.

let me know if it works for you :smiley:

Hi thanks a lot for your help!

But the same! I have make your modification to have “Unlimited Wall Jumps

I don’t know why I have this problem, cause it’s exactly the same i thinks…
If you can sent me your file it would be nice

In my debug mod i see, i can’t go into "Wall Jump (Right ) and Wall Jump (Left) ( Macro Jump )
Maybe the problem is here?

Thanks a lot :slight_smile:

Hello again :slight_smile:

The only reason I can think of at the moment might be that your character’s CapsuleCollider has a bigger radius than the Sphere Trace, or Line Trace amount.

Either way, here is my blueprint file:
http://pastelink.me/dl/a1221d

Drag and drop it into your blueprints folder,
then change the World Settings to make use of this character,
like so:

http://imageupper.com/s02/1/1/W1398443841646412_1.png

Let me know if it gives you the desired effect :smiley:

Thanks a lot…

I made the changes, but it’s the same… we can try something, can you take my Character in your Unreal Engine 4?

This is my Character :
Can you tell me if it works?

Hello, I’m not at my primary computer atm so I can’t test it, but could you perhaps also send your CharacterController?

Is your project derived from a template, if so, which?

Try this:
In the DetectWall function, change “Get actor **Right **Vector” to “Get Actor **Forward **Vector”.

I don’t know where is CharacterController
This is a SideScrollerBP Template but i have tried with the ThirdPerson Template and it’s the same

Same things, unfortunately

Have a look at this video to see how to set up the ThirdPerson and SideScroller properly:

Hi!

Thanks for your help!
I didn’t checked “Unlimited Wall Jump”… So sorry!

I’m so happy now! Thanks a lot for your help! Realy

Thanks again!

Hi there, would you mind re uploading the file again please? it seems the link is broken or dead!
Or maybe you could make a easier video to follow the way you did it?

Thank you very much for you help

i second that.

Yes please, re-upload the links or just the Detect Wall function script. I do not understand where the function ends.