• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Help with mouse position behaving strangely when camera following


I'm seeing an issue with the mouse_x value while a camera is following an object. This results in the mouse_x value sometimes being at the wrong pixel. So instead of the value staying accurate while the camera moves, it jitters.

You can see what I mean in the attached example YYZ by moving the player right into the red pixel, at which point the mouse_x value fails to update.

It's only happening when the player is on a specific pixel: 12, 24, 48, 61, 96...

Does anyone have any insight about what might be going on there?

Also attached is a reference file from GMS1.4 with the same setup, where this doesn't happen.



I've boiled this down to a simpler example, if anyone would be so kind as to take a look.

A 5x4 room with a 4x4 view and X Pos 1 shows unexpected mouse positions.

You can see in the example there's an orange pixel at 2,2. if you mouse over it, mouse_x shows up as 1,2
almost any other view settings will get expected results.

Can anyone please help me figure out what's going on here?