Is there a way to cancel the un crouch function.

I’m new to unreal engine and I’m trying to set up a crouch system using the built-in function.

So, this setup works fine. until I walk under something and try to un crouch then crouch before walking out from under it. even thou I called crouch again it un crouches when there is no longer anything in the way. so is there a way to cancel the un crouch function or something.

Hi there!

I’m not sure to understand.
You’ve tried to UnCrouch while having something above your head right ? And then, if you want to Crouch again it won’t work ?

Sorry I wrote the explanation pretty confusing. I think this might be a bit better.

When I run UnCrouch under an object it stays crouched like it’s supposed to, but when I run Crouch again while still under the object it will UnCrouch when the object is no longer in the way without me running the UnCrouch function again. So since UnCrouch was blocked by an object it keeps running until it’s clear even thou I called Crouch again.

Could do a quick line trace straight up before calling uncrouch, adda branch and if trace hit something do nothing, and on false, call uncrouch. Or use capsule/sphere trace that matches size of standing capsule.

Err, on second thought, I think the flip flop is just breaking it. Try doing this instead:

Ignore wires going offscreen to the right. Those are just sending BPI messages to follower NPC telling them to (un)crouch too.

the line trace would work but then if I try to UnCrouch under an object it would just not call the function rather than un crouching once the object was no longer in the way.

the branch node method works fine to, but if I go under an object hit UnCrouch then Crouch again it still un crouches when the object is no longer in the way, rather than staying crouched. but it still works good enough I might use it if I can’t figure this out.

thank you for your help.