• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • 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.

Box2D bug

E

erryox

Guest
Hi there,

I decided to try to make a game with physics, and I can not solve one problem. Next a lot of text, I hope everything is clear explained;) Just trying to describe everything in detail.

If two objects of the floor are placed closely, which are physical objects. And on them goes the player's object with a square collision mask. That is quite often the player object clings to the corner.

With fixed blocks I solved the problem by combining them into one fixture. But with moving objects are more difficult:

In fact, the surface is above horizontal. Tilt due to view_angle.

I even tried to turn off gravity. Objects should not touch each other. But the player still clung to the corners.
Then I noticed that the coordinates phy_position_y, as well as the angle of phy_rotation, are almost never constant and deviate to small values, something like this:

Apparently the point is this. But how to fix it, I have no idea.

I changed the size of the collision mask to half a pixel, this reduced the probability of a bug several times. But still I want to eliminate this possibility completely.
 
M

Matt Hawkins

Guest
You could try using precise collision detection.
You can turn it on with the sprite properties of your object
 
Top