Locking cursor/mouse on an object

Hi guys

I have a sphere that’s centered in my camera view. I want the boundaries of that object to define the boundaries of the cursor, so that it can only move on the sphere and nowhere else. Kind of like Screen.lockCursor with a larger radius. Any suggestions?

-Jon

You can’t control mouse position directly since that is in Windows or OSX. You can fake it by using a custom cursor and getting/setting the position of that. While negating the actual cursor.