How to detect if a character can uncrouch?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DigitalUnity

So I have a character who can only fit into certain spaces while crouched by way of sending a signal to her hitbox that scales it to a little less than half size and repositions it to (0,0) on the parent node, however if she uncrouches in these spaces, she currently clips inside of the level geometry. How can I make sure that the character remains crouched while in these spaces even if the player lets go of the crouch option?

:bust_in_silhouette: Reply From: andersmmg

What I do is have something like an area or raycast above the player, and adjust it to be where it would match the uncrouched player height when it is crouched.

Thanks for the advice! I just implemented this with a raycast like you said and it works brilliantly!

DigitalUnity | 2019-10-16 03:52

Is there a video about this ?

kareem_farrag | 2022-12-30 04:48