Camera going underground Pan issue


the camera which is going under the ground I want to stop it over the ground how can I resolve this issue when I use pan

Hi @Jack! If your ground is always on the same height, I think you can limit the y position of the camera pan somewhere. Did you use an example project?

2 Likes

That’s a good suggestion by @Albertos.

You can also check this third person controller example, it uses raycasting to find if the camera is behind other bodies (relative to a pivot point). And if that’s true it repositions itself:

https://developer.playcanvas.com/en/tutorials/third-person-controller/

1 Like

No, I didn’t use any example project. From which Y axises potions I should lock? If you have any example could you please share with me…?

In your code where you move the camera (orbit) down, you need to add a statement to check of the height of the camera (orbit) is above the ground height. If you share a link of your project I can check if what I said is correct.

okay i am sharing my project link please fix

https://playcanvas.com/project/924441/overview/thecubes

here is the project link

I can’t reproduce the issue in your project. How do I pan the camera orbit?

i just want to stop pan under the ground

I can’t get the camera under the ground, so how to pan the camera orbit?