Stopping free look camera movement from touch UI clicks

Cinemachine is great, and the free look camera seems to work pretty much out of the box with mobile touch. However, I’m struggling to work out how to stop the free look cinemachine camera reacting to click events on buttons placed on a UI canvas.

Any suggestions gratefully received.

1 Like

What? Nobody responded yet?

So the GUI layer in Unity does not by default hide the mouse events from the input manager. If the input manager is reading the mouse and feeding it to the FreeLook, this will happen whether the mouse is on a GUI button or not.

Your GUI handler needs to eat the event. See Unity - Scripting API: Event.Use

I’m having same issue please can you explain in detail how can I solve this, thank you

In the event handler for your button click, add event.Use(). That will prevent the event from getting propagated elsewhere.

Hi, now I have the same problem and the event.Use(); doesn’t work for me, it sends me a lot of errors, thanks.