Author Topic: Why does UICamera hide the mouse cursor?  (Read 2068 times)

zippo227

  • Jr. Member
  • **
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 55
    • View Profile
Why does UICamera hide the mouse cursor?
« on: July 03, 2015, 10:26:44 AM »
Why is there code in UICamera that arbritrarily turns on and off the mouse cursor? This resets the cursor position and makes it so that my player character cannot walk and move the mouse cursor at the same time. I've had to comment out the Cursor.visible = true and Cursor.visible = false lines in UICamera to get my game working again.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Why does UICamera hide the mouse cursor?
« Reply #1 on: July 03, 2015, 11:46:04 AM »
Happens when you get joystick input. You may have WASD bound to joystick axes by default, with same axes specified on UICamera.

devomage

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 67
  • Posts: 250
    • View Profile
Re: Why does UICamera hide the mouse cursor?
« Reply #2 on: July 03, 2015, 02:50:54 PM »
Why is there code in UICamera that arbritrarily turns on and off the mouse cursor? This resets the cursor position and makes it so that my player character cannot walk and move the mouse cursor at the same time. I've had to comment out the Cursor.visible = true and Cursor.visible = false lines in UICamera to get my game working again.

this recently became a huge problem for me as well.  the cursor snaps to the center of the screen.  is there a way to toggle this behavior?  i've yet to look into it, but is very annoying.

edit:

commenting out line #: 492, 493 and 506, 507

fixed the problem for me...
« Last Edit: July 05, 2015, 09:45:59 PM by devomage »

zippo227

  • Jr. Member
  • **
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 55
    • View Profile
Re: Why does UICamera hide the mouse cursor?
« Reply #3 on: July 08, 2015, 09:55:58 AM »
I commented out the same lines relating Cursor.lockState and Cursor.visble. Yes my Navigation X and Navigation Y are set to Horizontal and Vertical respectively, and my Horizontal and Vertical take joystick input. I can kind of see why you would want to have special joystick configurations, but it seems to me that the default should treat the joystick like a mouse.