Exit collision but running into a wall with the same collision?

How would the enemy exit collision if they are running into a wall with the same collision?

Did he do his collision differently than me (I had to use polygon so they didn’t keep falling through. I just don’t get how the platform collision would exit at the corner.

His is similar to this but why would the collision stop at the left edge? The enemy is still in the collision.
sshot-2021-12-22-18-52-18
sshot-2021-12-22-18-52-49

I fixed it with a Monster Grid Tilemap so my enemy doesn’t interact with the ground anymore but I just don’t understand how they would exit the collision on the left wall.

Hi Avocado,

Unfortunately, the tilemap collider is sometimes a bit buggy. Disabling and enabling again usually forces Unity to recalculate the shape, and that usually fixes the problem. Try to use an edge collider.

In my picture are there three different colliders? Or is it all one colliders. I was assuming it was all one collider but if unity considers each green square as a collider then I understand how you could leave the first collider. I had thought it was considered one collider.

Is it 3 colliders like the white or one like the red?
image

In my picture are there three different colliders? Or is it all one colliders.

It depends on what you define as collider. If you are referring to the collider component, and there is only one component, the collider is “one collider” but it is consisting of multiple segments.

Acutally, the collider shape is supposed to look like the red line you drew in your screenshot, not like the three segments.

I’m asking for how it would respond to enter or exitcollider2d

I’m afraid I do not know the answer. You will have to test that during runtime.

1 Like

Privacy & Terms