Is there a way to prevent the collision shapes from overlapping ? That the character stops moving to the left once the collision objects detect the wall? Completely accurately?

The Blue Player Collision Sphere and the ground box are overlapping with the tilemap collision.
I want to have absolutely accurate collisions, where this does not happen.

I use a slightly modified version of the basic 2D platformer template defold player script:

Something that is very strange is that when I try to change these 5 values here that I have marked blue:

That nothing really changes in the game, it’s like those values stay the same, even though I have changed them completely, that the build game does not recognize other values.

So…

Does anyone know why defold does not accept changed values? That the game plays like It’s still a 0.7 even though I changed it to a 1 or 0 ?

Does anyone know how to accurately prevent the spheres from overlapping? To have accurate collisions?

I made a small video showing the problem.

I want to move around and press against the wall without the collision box " pressing in " like that or getting stuck.

1 Like

The idea is that the top portion of the code you shared should separate contact points so that there is no overlap. In your screenshot it will overlap a bit every frame when moving left and then get separated again on the same frame. You should not see any jittering or similar in the movement while moving against the wall.

“You should not see any jittering or similar in the movement while moving against the wall.”
But, well, that is still happening…

I made a small video showing the problem.

I want to move around and press against the wall without the collision box " pressing in " like that or getting stuck.

But you are not going to have the collision box visible in the released game will you? And as long as the actual sprite is not jittering then I don’t really see the problem?

There is a reason the template project uses spheres and not boxes. Boxes and their sharp corners tend to get stuck like in your video. Change back to spheres.

1 Like

Changing back to spheres results in the ground being unreliable, standing on a corner of a platform becomes a problem.

Here is a video showing that problem as well.

You could try a combination of spheres and a ground box.

I am sorry to bother again, but this only leads to this:

The character gluing on the wall