Saturday, September 10, 2016

unity - How can I attract & repel the mouse cursor from particular UI controls?


This question came from some of my students. I wanted to share it here so others can find & improve on the solutions we've found so far.


In particular, my answer below doesn't behave as well as I'd like in windowed / editor mode - UI buttons no longer respond to hovering the cursor. I welcome alternative answers that solve this more completely.




We're making a visual novel game using the Fungus asset for Unity.


We want to add a twist where some dialogue options are easier or harder to press, because they attract or repulse your mouse cursor.



Unfortunately, we haven't been able to identify a cross-platform way to manipulate the mouse's position, nor a way to create a "Fake" mouse cursor image that can still interact with Fungus's UI buttons.


How can we pull this off?




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...