Hello all,
Firstly I want to thank and give all credit to my Lord and Savior Jesus Christ for showing me a solution to achieve a reliable ledge movement system. This system can be expanded upon as new features are added.
The problem I had first began when I could not find any information in the ledge climbing tutorials out there on how to achieve accurate left/right movement while hanging from a ledge in relation to your camera’s current rotation. Everything worked fine when the camera was behind the character, but if you rotated the control 180 degrees so the camera would face the character, your character’s movement input would be** inverted** (ie. you would have to push the thumbstick right to move to screen left and vice versa). Additionally, when the camera was at 90 degrees to the character, the logical up/down thumbstick movement would not be available at all.
The function “LedgeMovement” I will show you solves both those problems. But first, you need to have a ledge climb system in place! I recommend starting with Crocopede’s excellent tutorial series and doing the first 2 videos at least:
You will want to substitute the AlignToWall macro created in the video with the following setup (which he created sometime after the first 2 videos were made). I used a function instead of a macro here, and set it to “Pure”:
Next, you will want to follow up with Medel Design’s excellent series. He bases Part 1 on Crocopede’s videos, however, I personally decided to stay with Crocopede’s original setup for this first portion, as the above AlignToWall function worked better for my character, and overall I had better stability. For Part 2 though, you will want to substitute a few things in Medel Design’s video:
First, you will want to Get your Character Movement component and disable Orient Rotation to Movement. Optionally you can reduce your Max Fly Speed here, if you want your character to move slower when shimmying on ledges. Insert the nodes where shown below (the setup below uses the WallGoToLocation and AlignToWall functions [or macros] from Crocopede’s series):
Next, you will want to re-enable it (and update your fly speed) in the following locations:
Now, we can substitute Medel Design’s function “MoveinLedge” for this new LedgeMovement function. But first, here’s how my Tick Event is currently setup. Again, it more closely resembles Crocopede’s original series with the addition of Medel Design’s Left and Right Tracer functions. The “Wall/Ledge Detect” event is a Custom Event connected to a Sequence node that fires both the Wall Trace and Ledge Trace setups (as shown in Crocopede’s video, or the equivalent of “Forward Tracer” and “Height Tracer” from Medel Design’s video).
Finally here is the new function itself (Right Click and open in new tab for Full Size). The CanMoveRight? and CanMoveLeft? booleans are from Medel Design’s 2nd video, and are set using the LeftTracer and RightTracer custom events in his video. The LedgeMoveInput variable is my own variable used to drive a blendspace in the AnimBP for moving left/right. All other variables are local variables that exist only in this function.
That’s everything! As mentioned, this system may be modified as new features are added. I hope this helps someone!
-Adam