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
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
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!
Thanks a lot! It is super cool to try to help me, really
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
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?
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:
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)
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:
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