The mouse's position is reset to 0,0 when using the chat box

Thread has been recycled because I found the actual cause of the bug

As seen here. Look at the bottom right to see your mouse’s position. I’m reading from PlayerMouse.X and PlayerMouse.Y.

This causes a problem in a game I’m working on because the mouse’s X and Y coordinates are used to determine the mouse’s X and Y coordinates. I imagine this is an issue with CaptureFocus, and not the chat box itself.

EDIT: Please be aware that the mouse’s position isn’t actually being changed. Just the properties .X and .Y are being reset to 0.

Any word on this?

Share the cause? Because it seems interesting to be able to reset mouse position.

Edit: Oh, never mind. I thought you realised it was your bug, so i thought you found a nice way how to set mouse’s position.

I’m sorry that I wasn’t clear. My game reads from PlayerMouse.X and PlayerMouse.Y to determine the mouse’s position. The chat bar isn’t actually moving the mouse, it’s just setting those two properties to 0.

Does this happen with all TextBoxes?

It just occurred to me that I could use the command bar to CaptureFocus and run a test. I’ll be doing that when I get home in three hours.

I just checked this and I can confirm this happens on both windows and mac. Leaving the window on mac also causes the AbsolutePosition to go to (-5000, -5000). It indeed only happens when CaptureFocus is used.

As a quick fix you could detect the jump in AbsolutePosition to go to 0,0. Just store the last values and reuse them until the mouse has moved. You know the deal.

[sub]OFFTOPIC: Incredibly nice use of Surface GUIs and interpolation. I loved the arrow animations.[/sub]

Update: This also occurs when opening up the stats windows (Ctrl+Shift+F1, Ctrl+Shift+F2, etc.).