Detect moving camera

Hi everyone!
How can I detect if the camera is moving, to take action when this is true?
I need to take action when the camera is moving.

Spanish:
Hola a todos!
Como puedo detectar si la camara esta en movimiento, para realizar una acción cuando esto sea verdadero?
Necesito realizar una acción cuando la camara este en movimiento.

Check if the object you are centering on is moving.
If you aren’t centering camera on an object then make an object and make it follow camera and check if that object is moving.

There maybe are better solution out there, but this is what I can give you.

HI @kok86 ,
I really don’t understand. Your code move the camera, so why you need to know if the camera is moving ?

You move the camera in events so you can set boolean variable like ‘isMoving = true’ or false and check it later.

or you can calculate the difference in previous CameraX and current CameraX and if it’s >0, the camera has moved.

1 Like

Or CameraY. Otherwise this is the solution I’d go for.

with the mouse scroll the camera moves vertically or with the extension “Drag Camera With Pointer”. (for mobile version). But if touch starts the movement of the camera just above an object that changes scene when touched, it changes the scene without intention.
Suppose I have a menu with options where I need to move with the touch, and I start the movement just above a link, it is activated, therefore, I need to evaluate if the camera is moving, to deactivate the functionality of that link.

spanish:
con el scroll del mouse se mueve la camara de forma vertical o con la extensión “Drag Camera With Pointer”. (para version movil). Pero el touch si inicia el movimiento de la camara justo arriba de un objeto que cambia de escena al tocar, cambia la escena sin intensión.
Supongamos que tengo un meno con opciones donde necesito desplazarme con el touch, e inicio el desplazamiento justo arriba de un link, este se activa, por eso, necesito evaluar si la camara esta en movimiento, para desactivar la funcionalidad de ese link.

post a example please.

I would be needing something like that

Are you moving the camera? How are you doing it?

For pc: Scroll Mouse
For mobile: extensión: Drag camera with the point

PC:

Mobile: (very problem jeje)

For PC: Use these events to check if your mouse is moving or not


And for Mobile, I will check.
Edit: I checked it and here is a workaround:

By doing this, you will know the camera is scrolling when the variable scrolling is True

Implement the other extension, since it only works on mouse scroll, but not touch on mobiles.

I can give value to a variable when that happens Movement = 1. I do not know if, it will take that variable if the camera is moved with the other extension for mobile.

I think this will work

I will be testing and I will tell you the results!
It’s late I must sleep! tomorrow I will be reporting the results! Thank you so much

You could always just have an event that compares the CameraX(“layernamehere”,0) to a scene variable as a condition, doing the same for Y, too.

If either don’t match, update the variables with the current CameraX/Y, and do your other actions.