Character model penetrates the ceiling after stopping "ctrl" (crouching)

When I go up to the ceiling and hold down “ctrl” (crouching) it works fine. If I stop holding “ctrl” my character goes up and penetrates the ceiling. The camera with a separate model of hands remains in the crouch position, the other character model stands up. I am creating a first person game with a third person, only me can see my hands, and the opponent sees the model of the character that has created animations. It seems to me that when I stop holding “ctrl” it goes back to the “idle” animation, but I don’t know how to make the crouching animation work until I leave the low space.

How can I do this?
Sorry for the poor English, I use a translator.

hmm…I thought the character movement already did keep crouching if uncrouching would cause the capsule component to go through a blocking surface (assuming you are using the built in character movement crouch).

This may be a silly question, but does your ceiling have collision on?

Thank you very much, it worked. I had “crouch true” instead of "is crouched

Yes, there is a collision of the ceiling because if I go without crouching it gets stuck and I can’t pass. I am using the built-in character movement crouch and blend space crouch animation.

I think the animation forces you to stand up and crashes into the ceiling, and the crouching collision stays while crouching.

I notice you have created your own bool “crouch true” rather than using the built in one. In your animation blueprint, is that the same bool you are using to decide if your character is animated as standing or crouching?

If so, you could try changing the animation blueprint to the built in crouching bool in character movement instead (I believe it is called “bIsCrouching” or something similar). I believe that one would follow the capsule component which already respects collision.