Page 1 of 1

Why can players peek into the Void

Posted: Sun May 23, 2021 11:51 pm
by pango
I've been wondering why players can sometimes see thru ceilings into the Void, and noticed something:
If, inside the editor, you look at player's model, or at player under normal conditions, you can check that the camera and the part of the near clip plane that's within field of view and both nicely inside the character controller capsule:
player model.jpg
player model.jpg (30.84 KiB) Viewed 5374 times
However, when you can peek inside the Void, the camera gets outside of the capsule:
player camera.jpg
player camera.jpg (71.24 KiB) Viewed 5374 times
That puzzled me for a moment, and my hypothesis is that the culprit is the head dipping mechanism, that shortens the character controller capsule, but neither the smooth follower nor the camera that's attached to it are adjusted for that change.
(I noticed that the head dipping itself depends on camera position, so fixing the issue may be more involved than expected...)

Re: Why can players peek into the Void

Posted: Mon May 24, 2021 12:25 am
by Interkarma
This used to happen with crouch as well.

I didn't think of this case with head-dipping, which was only meant to be a momentary thing when crossing through certain low doorways. There's also an unsatisfying "bounce" if you can position head-dip right in the sweet spot.

I'm not so worried about this case, but it would be nice to polish out later if it doesn't create problems elsewhere.

Re: Why can players peek into the Void

Posted: Sun Nov 13, 2022 9:31 pm
by pango
Okay, trying to debug this issue, I noticed I did not understand correctly how head dipping works...
The two raycasts that are used are horizontal and have exactly the same reach, so when approaching a vertical wall they should hit exactly at the same moment and not trigger head dipping.
Back to the original observation, that means the camera can escape the player capsule, most likely for another, unexplained, reason...

(P.S. as a micro-optimization, eye raycast could be done only when head raycast hits)