Physics object getting stuck between 2 other physics objects

I don’t know how to explain this well, but I decided to use Physics2 for a 2D Minecraft kind of game, and for some reason the player randomly gets stuck between blocks and you need to jump to get unstuck???
actually poop fart

Deleted the original post because I thought it was more fitting here

The most likely culprit is that the ground blocks aren’t even, with some lower than others.

nope. they’re all at a 16x16 grid, exact same y axis

Collisions (in physics extension) are squares? Collision of player is square too?

rectangle but yeah, collision of ground is perfect 16x16, player collision is 4x28

Uhm… Try to push away player from blocks when moving…

What do you mean? I dont understand.

Would it be better to just use PlatformerCharacter instead of physics? Considering I’m not doing anything that would need physics

1 Like

It would be much easier. The platform behaviors have builtin conditions and actions.

1 Like

Physics objects are constantly overlapping each other when colliding, which is ironically more realistic since real collisions happen over a period of time rather than instantaneously. Because of this your character object is actually sinking into the blocks slightly and then colliding with the corner of the next one.

Manually separating them could be one solution… but if you aren’t making full use of the physics behavior then it may be overkill

1 Like

I don’t think this is correct. The physics engine will be separating the two physics objects continuously, so no overlapping and sinking into a physics object will happen.

1 Like

It is. They do separate but not instantly. So, if you have a continual force such as gravity pushing the object into something static, equilibrium will be reached with the dynamic object sunk into the static one just a little bit. I discovered this by trying to test if an object was resting on top of something else by testing Y position… found out that I needed to include a margin of a pixel or two. Of course it depends on the relationships between forces applied, simulation scale, and game resolution.

I’m going to check this out. I can’t believe physics would trick me like this :cry: