boxing in a cursor

i would like to have limits imposed on where my cursor can go (i.e. i want it to be able to move in the XY plain, but not to areas off the menu i am creating).
i tried boxing it in with planes, but then ran into 1 of two problems:

  1. either the cursor wouldn’t colide with the plane and kept on going right through it
  2. the cursor would collide, but would also be effected by gravity and would thus fall to the bottom of the screen.

any suggestions on how to do this?

thanks in advance,

Oh, I wouldn’t really rely on physics to keep your cursor in a certain place - you probably should use Python, unless you’re trying to do it in a particular 3D space. If that’s the case, then you could, say, only move the cursor to the mouse position if that position is hitting a ‘free space’, so to speak. If you want to use dynamic physics for a cursor (not recommended), you could give it an upward force equal to gravity (9.8 or 9.81 (I don’t remember which) by default).