Hi There! New to UE5 and new to the forum. I’ve created a true first person controller based on the third person template and implemented a leaning mechanic.
See the leaning mechanic logic here:
The leaning works fine, but the problem I’m having is that if the player is parallel to a wall and leans they will clip through it (mesh and camera).
Here is my modified version of BP_ThirdPersonCharacter:
I attempted to resolve this using line traces and some math that made my brain ache, but I wasn’t quite getting the results I wanted and I struggled to make it work for all situations - hence why the “Get Lean Distance” function outputs are unplugged.
My question is this: can someone suggest a good (ideally the best) way of handling this? It’s surely a common issue and I’d imagine I was severely overcomplicating it.
Any advice would be greatly appreciated, thanks in advance.