Mouse cursor position shared beetwen different builds.

Hello!
I’m making 2D multiplayer game and I currently have the game mechanics and client-server structure. Everything works just fine, I’m synchronising position, rotation and it’s perfect. The thing is that when I test it I have two different windows on left and right side of the monitor (client/server) and one of them is always not active (I “play” only on client for example and look what’s going on on both) but the cursor position is always being read on both of them.

I’m looking for function that would block this behaviour. Something like:
if (windowIsActive) → rotateTowardsMouse.

Thanks for any help!

You could try getting the total screen width or screen height (depending on how your monitors are set up) and dividing the value by two, depending on which half it is on then you could use your “rotateTowardsMouse” function.

Let me know if I misinterpreted your question.

You may want to look into OnApplicationFocus() for this. It returns true or false dependig on whether the window gets or loses focus.

You could create a UI cursor and read the position on this instead.