Check the free space above a character

How to check the free space above a character? I want to prevent the character from standing up if there is an obstacle from above.

Depends on your implementation, but say your character stands up on a button press. Before you do the standup action you could perform a raycast (or better shapecast at the size of your character) upwards. Ideally you’d only cast as far as is needed for your character to stand up - and if there are no hits (collisions) by the ray/shapecast then you know you have enough room to stand up.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.