I finished this Unity 3rd Person Combat & Traversal course recently and wanted to continue working on the climbing movement some more. I’ve been focusing on a new PlayerShimmyState which allows my character to shimmy along the ledge by the X axis with mixed results, mostly very buggy. My original PlayerShimmyState.cs was merely an iteration of the PlayerPullupState.cs albeit along the X axis with a Braced Hang Shimmy animation from Mixamo, and this new state mostly works bar three main bugs:
- Even with an appropriate Offset Vector3 and a shouldFade boolean connected to the PlayerHangingState.cs (similar to the one connected to FreeLookState via PullupState) it looks awful, with my character snapping into the new position.
- I haven’t worked out a solution for the PlayerShimmyState to detect when the character slips off the Ledge along the X axis, as in, when the LedgeDetector collider separates from the Ledge collider, and so once in the ShimmyState my character can shimmy forever.
- Rather amusing but just because of animation constraints, my character can only move left even if I press down right.
I decided a cool solution would be to actually combine the PlayerHangingState, PlayerPullupState and this new PlayerShimmyState into a full-blown PlayerClimbingState with it’s own blend tree (2D Freeform Directional), parameters and animations for each axis, drawing mostly from the flexibility of the PlayerTargetingState.cs, and despite it currently being incomplete I really quite like this solution because it solves problems 1 and 3, and also looks a lot more fluid. However a new problem has come up: when I hit A or D to ‘shimmy’, the character comes off the ledge collider completely. It quite literally looks as if my character, when shimmying, is just back on the ground (by its CharacterController) but shimmying in mid-air, so it’s effectively not much different to a Target or FreeLookState in terms of movement. It occurs to me that the state machine in this configuration can no longer detect if I’m intending to slide along a ledge collider and relies on offsetting a Transform like in Pullup.
So I’m currently looking for a solution to upgrade my ClimbingState and making sure it all works. I’ve been looking into YT guides on ledge climbing and also Raycasting, but it seems I’m somewhat out of my depth here. I don’t want to rely on Offsets and booleans because except in PlayerPullup, it just doesn’t look very good and feels pretty rigid. I imagine if I find a solution it will require a lot of refactoring in several scripts, but I’m willing to do the extra work if I get a neat ClimbingBlendTree working.
Also the vast majority of my code right now is identical to the course material but if anyone wants me to post snippets, I can do that.
Thanks,
Maezumo.