TheYellowArchitect / doubledamnation

Exclusively Co-Op Metroidvania with Movement as smooth as Smash Bros Melee
GNU General Public License v3.0
19 stars 2 forks source link

Level Editor - Pausing Enemies #37

Open TheYellowArchitect opened 2 years ago

TheYellowArchitect commented 2 years ago

Each ground tile has 1 BoxCollider2D In the below images, the hollow running to the right (runs towards the player), stops as if it hit a wall to the right. Sure, if the right ground tile was higher in elevation, even by a pixel, the box collider would instantly stop. But this is not the case, as you can see in the images below.

pauseenemyBug4 pauseenemyBug1 pauseenemyBug2 pauseenemyBug3

Since the colliders are at the exact same height/elevation, I think it is a Unity Engine bug. For now, I did a disgusting hack, which is: if (level editor && not satyr) sidewalled = false;

Optimally, I would merge the ground tiles in the level editor, which would result in great performance too. But dont collision meshes merge by default, when they are marked/tagged as static? -_-

P.S. GroundCollision attached to every enemy, has nothing to do with sidewall, because it exists exclusively to check if grounded. Child's trigger collider certainly doesn't trigger parent's normal collider. tl;dr: The bug is located in EnemyBehaviour and that same gameobject's collider.