How to change the rotating radius of UniversalCamera

I made a simple UniversalCamera for an FPS game. I want to set position of camera’s y-axis something like 0.5 or at least below 1. But if y-axis less than 1 (given that ground’s y-axis is 0) when I move camera up and down, the graphics get clipped. Seems like camera’s head is going below the ground like an ostrich and this is causing the issue. If I set y-axis to be something bigger than 1 then it all works good but I don’t want to change this value.

Looks like the rotation radius is 1 but I want to change it so I can rotate my head in small movements. Or may be change the pivot point of the camera rotation axis if such thing is possible?

I tried changing ellipsoid but that didn’t work. Any help or suggestions would be appreciated. But as I mentioned I don’t want to change y position in line 6. Here’s the playground:

Also captured my problem in a gif:

Thanks in advance.

Maybe this simple example will suit your needs - https://playground.babylonjs.com/#0VHCTL#32

3 Likes

Thanks. Just noticed I was missing below part. I saw that in your example. No more clipping. Cheers.

camera.minZ = 0.1

2 Likes