Orbit camera

In my project I was trying to configure a way to make the camera orbit around a plane and I found this tutorial: Orbit camera | Learn PlayCanvas
But I want to make an exception in this code, because I also have a scroll bar and an image and when I drag the mouse with the scroll bar the camera also rotates. How could I fix the camera to don’t rotate when I drag the mouse in the scroll bar and the image?

Hi @Joao_Pedro_Kuhn and welcome,

A common way to do that is to add a global variable and set it to true when your mouse is on the scroll bar and/or image.

Then update the orbit camera script to bypass and logic run in the update method when that global variable is true.

1 Like

It worked, thanks

1 Like