• 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.

Windows Issue with Physics Collision Mask offsetting 1px in x and y

T

tagomago

Guest
Hi,

I am trying to set up a simple Physics Room with 16x16 objects. In the Collision Shape panel I snapped the exact box shape, but when running the game the collision shape always offsets 1px to the right and 1px down, which causes objects to simply get stuck and not pass 16x16 gaps. I'm uploading a screenshot with a montage of what's happening. This happens with every single different object that uses physics in the room.

Kind regards

collision-mask.png
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
That sounds like a bug... Please got to "Help > FIle a Bug" in the IDE and post it, along with a link to the YYZ of the test project (you can create a YYZ using the FIle > Export option).
 
T

tagomago

Guest
Thank you for your reply Nocturne, I just reported the bug and submitted the YYZ like you asked.
Just in case someone else on the forum has any idea of what's going on, I'm posting here a couple of images illustrating the problem.
In the game, I'm trying to use the player box (16x16 sprite and collision mask) to push a 16x16 box through a 16x16 gap.
As you can see on the images, the boxes position/sprite?/collisionmask? is offset a little to the right&down, but enough that I can't get the box to go through the gap.
Also, when I move the player box inside the gap (which it manages to enter), it starts shaking and bouncing between the walls.

Any idea why?!

Kind regards

01.png

02.png
 
T

tagomago

Guest
Update:
I realized the problem with the sprite not snapping to the game's pixel grid was because I had wrongly multiplied the scale variable in the surface_resize(), instead using it in the draw_surface_ext().
But it didn't solve the issue with the collision box. Even when I activate physics_draw_debug() I can clearly see the bounding box expanding 1px to the right and down. Objects are still getting stuck :(
 
Top