The slow blade penetrates the shield (collider question)

Hello All,

Have an interesting problem and I am hoping it is something simple.

I have an ortho scene, tile based, side on (it is a vertical game, there is digging :-).
Each tile has a box collider, (the tiles are re-used as you scroll around) and each collider can be either a trigger (so you can walk through it and possibly have some effect befall you) or just a regular collider that impedes your movement (in the case of a wall or pillar).

So, the outer walls are a fence of box colliders all right next to each other.

The character has a character controller collider.

Everything works great.

Except on windows, in the web browser, if you go slow and ‘wiggle’ the character while pressing into the walls, you can slip through the collider.
Usually at about a 45 degree angle to the wall.
I cant get it to happen in the editor (on my mac) or in safari or firefox on the mac either, but the windows testers can get it to happen consistently.

At first I thought that the character controller was ‘popping over’ the wall colliders (ie moving in Z when they shouldnt be) and I made the colliders big enough to rule that out.

Anyhow, I have a few plan-b’s one is to start changing the physics settins wildly to see if that does anything and the other is to build a positional map based on the tiles and restrict the player from moving into them like that.

However I am hoping that someone can help me so I can avoid both of those scenarios :slight_smile:

Cheers!
-Ben

Ok, I sorted it out. Perhaps this is a bug, or perhaps this is just a best practices issue.

Anyhow, the problem is that the box colliders I was using were the same size as the tiles (the tiles are 128x128, the colliders were the same size (with some height of course). While the colliders did not technically overlap, they did touch on all edges.

In the editor and on the mac browsers this was not an issue. The colliders worked as intended. On the windows browsers however, you could slowly push up against the the spot on the box colloders where they touched and eventually just ‘break through’.

I changed the colliders to be 126x126, leaving a 2 pixel border all around and the problem went away. I could probably have made them 127.5, but 2 pixels is perfectly fine for my uses.

Hopefully this helps someone else out!

Cheers!
-B

but look down. We’d have joined each other in death.