Legacy GM Physics set awake

K

KriLL

Guest
Hi guys,

I have noticed a possible strange bug. I have made a physics (gravity 45.0) world (1920x1080 @ 60 fps) put a few boxes in it (64x64 pixels) and set the physics awake variable to false (asleep) for the boxes.

What I have noticed is that if the boxes are 1 to 4 pixels away from each other (even though they are not touching) they will interact and fall to the ground at room start. If they are 5+ pixels away from each other then they will not interact at room start due to them being asleep.

Anyone know why they are doing this? If they were touching I would expect them to interact but not if their collision masks are 1 to 4 pixels away?

Thanks
 

Yal

šŸ§ *penguin noises*
GMC Elder
Are their physics fixtures overlapping? That's what matters once you turn on physics, not the sprite. You could use the physics debug drawing function physics_draw_debug() to check what GM actually uses for collisions.
 
K

KriLL

Guest
Cool will try that and see what i can find. The collision mask is done via the use physics tickbox so i xan see the box around the sprite so they shouldnt overlap but hopefully that command will show me more.
 
K

KriLL

Guest
Are their physics fixtures overlapping? That's what matters once you turn on physics, not the sprite. You could use the physics debug drawing function physics_draw_debug() to check what GM actually uses for collisions.
Hey, I tried out what you said and I can see both of the boxes collision masks are not overlapping or touching at all yet they still interact with each other if they are 1 to 4 pixels away... I can see a game between their physics collision masks in debug mode.
 
K

KriLL

Guest
Hi all,

I have managed to figure out what is causing it. It is all based on the value of Pixel to meters. I have it currently set to 0.05 which means that anything within 4 pixels of each will start to interact. I found a value of about 0.25 means that 2 objects can be 1 pixel away from each other without any interaction.

This is all while they are set to physics awake off on room start.
 
Top