Hello! As the title implies I have a game with both a wallrun mechanic and a double jump, and I want the wall run mechanic to refresh the player’s double jump. I was hoping to do this with the built-in jump max count and jump current count variables since they play into the character blueprint’s ihernent jumping code, but I find that I cannot manually reset the JumpCurrentCount variable in blueprint, I even opened the character.h file and it says that it’s blueprint readonly. Is there a workaround for this and if not, would it be safe to edit the cpp files and make it editable in blueprint?
Hey @treeese!
You can handle jumping yourself like this
This way you can reset the jump count whenever you like!
(The Max Jump Count
property should still be set to a value above 1 though)
You can also do this:
To be able to dynamically assign the jump velocity from the blueprints like this:
Hope these help!
Hi, can you try just calling StopJumping
when player is starting wallrun? I haven’t tested it myself, but as I can see the Character.cpp code, StopJumping
calls ResetJumpState
which sets JumpCurrentCount
to 0, so hopefully it will do the job.
Regarding your question about changing cpp code, usually something is only readable for a reason. And even if it’s fine to adjust, still to make this change work you would need to download UE source, modify it there and recompile everything. Quite problematic just to change one variable.
To this day I still don’t know what that node does
Didn’t even work for that purpose!
So I figured it out!
Basically I have my max jump count set to 2 by default, and whenever I initiate a wallrun it gets increased by one, however it is clamped so that it can only greater than the current jump count by 1, as otherwise you could farm essentially infinite double jumps by reattaching to walls without double jumping. When jumping off of a wall I use my own code so a jump isn’t used. Landing resets the max jump count to 2.