• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

GMS 2.3+ mouse_x and mouse_y fail to change unless player moves

Pahsunaal

Member
Hi,

For some reason, when I read mouse_x and mouse_y, they return the same values each time they are read (to be clear, mouse_x != mouse_y) unless I move the player first (by updating their x and y variables). This seems like very unusual behavior. Anyone experienced a similar issue or know of a way to fix it?

Thanks in advance
 

Ommn

Member
Put this code in Step Event
GML:
show_debug_message("mousex = "+string(mouse_x))
show_debug_message("mousey = "+string(mouse_y))
What appears on the screen when you move the mouse?
 

Ommn

Member
Are you sure to put the code in Step Event?
please sure again
Step Event not mouse event or create event
 

Pahsunaal

Member
Are you sure to put the code in Step Event?
please sure again
Step Event not mouse event or create event
I discovered the origin of the issue: view_visible[0] = true. For some reason setting this to true stops mouse x from changing. Is this a bug in the software? How do I fix this issue?
 

Pahsunaal

Member
I discovered the origin of the issue: view_visible[0] = true. For some reason setting this to true stops mouse x from changing. Is this a bug in the software? How do I fix this issue?
I discovered the issue. I had not set the viewport size appropriately, although it seemed to still display a 1920*1080 window. In any case, setting the size of the two views I was using seemed to fix the issue
 
Top