- Edited
To check if the character has enough space to stand up I use a shapecast with a sphere shape.
But I noticed some strange behaviour that I don't understand.
In red you see the sphere, indicating it is colliding.
But once the spheres center is inside the colliding object it doesn't detect a collision anymore if only the "roof" is part of the collsion.
If I move towards the sides, so it touches the "roof" and one of the sides, it detects a collision again.
Moving the shapecast a bit down so it's center won't end up inside the "roof" gives the expected result:
But I can't lower it, the character would stick inside the "roof" when standing up. The shapecast has to be positioned like in picture1.
I don't know what to make of this.