ACharacter's UnCrouch very buggy

I’ve seen this problem asked before: You crouch Mr. Mannequin under a static mesh that is supposed to block him. It seems like ACharacter’s interface and the MovementComponent do some tracing and math to figure out if character can actually uncrouch.

Problem is, this doesn’t work straight out of the box. My mannequin still uncrouches and goes through the blocking mesh above him. And he actually walks through it (no running though, so reduced speed in a way) with his head running through a platform above him (doing a side scroller platformer).

Any ideas? Do we have to mess with the provided interface, customize our own? Very frustrating as it feels like this should work automatically…

One way to solve this specifically would be, prior to executing uncrouch, to do a capsule trace upward and check for hits against objects you don’t want to be able to uncrouch into. If there are no hits, then execute uncrouch, if there are hits, then don’t.

My personal preference is to use a range between crouched and fully upright, rather than the out of box modes, and resize the capsule, change walk speeds etc. accordingly, but it all depends on what you want to do.

Thank you for the time you took to think about my problem. Much appreciated. But the heart of my question is: why doesn’t it work straight out of the box? If you see the ACharacter’s (and its movement component) interface that’s what they’re trying to do too! They have all this intricate algorithm of detecting collision height etc., even stuff like “something is just a little bit above us maybe we should try and scoot the character down and fit him in”!

It seems to me it’s duplicating effort, but anyway, I’m just really perplexed and curious why it fails to work. I wonder if it has something to do with the meshes I’m using for the obstacles above while crouching…

Update: I may have to rephrase / replace my question:

I performed a little experiment and I created a new anim blueprint afresh using the specific original skeleton of the crouch animation I’m using. (MoCap Basics for Mr Mannaquin - free on Marketplace). What I have done earlier is I took the animation, imported it in my own template, deleted the skeleton that the MoCap animation started with and retargeted it to Mr. Mannequin of my template. Somehowit has messed up his ability to detect collisions when uncrouching… thoughts any one?

Generally speaking, animation is a cosmetic layer. The CharacterMovement component uses the capsule. As for why the out-of-box functionality is what it is, my guess is that Unreal tries to keep things pretty general so that they’re easy to use in projects that have wildly different demands of the engine. Depending on the needs of your project, you might be better off building some functionality from the ground up rather than trying to work with the inherited behaviors. Again, it depends exactly what you need for your project.

As for the animation stuff, I don’t think retargeting an animation from another skeleton to the Unreal Mannequin would have any effect on the functionality of Crouch/Uncrouch. Is there a particular reason you wouldn’t want to do a trace check before executing Uncrouch?

You may also be having issues with collision settings. Does your capsule stop colliding with certain objects after crouching or uncrouching that it collided with before? Are you trying to perform collisions with the mesh and not the capsule?

I am not trying to do anything fancy with collisions no… I just felt lazy re-inventing the wheel and it seemed like UE4’s functionality should work out of the box, which I was impressed by. Then got a bit disappointed that it was actually glitchy. But I’m sensing there should be something wrong with the skeleton I’m using. Can’t tell if it’s because I imported another outside animation for it and it got amended now or if it has been already buggy. The specific crouch animation is working flawlessly when used with its original mesh and skeleton (technically still ue4’s mannequin but there must be some small differences).

Anyway! i’ll be moving to a new character with other animations and hopefully shouldn’t experience problems. But if I do, your suggestion is probably what I’ll have to do. Or cheat a bit and use “crouching trigger volumes” in places where i know character should crouch (and not be able to uncrouch) and regulate behavior that way.