- Home /
Lode Runner: Walk Over a Hole with Enemy
Hello World,
I am basically making a remake of Lode Runner and I am having a hard time to do the mechanics for the hole digged.
The game is a 2D platform (thus using sprite and BoxCollider2D). I am not using any rigidbody here. Each cell of the game can be either {Empty | Ground| Ladder | Coin | Exit | Bar to hang}. The question is about the Ground. Each ground is surrounded by a BoxCollider2D with a LayerMask. If I dig a hole then obviously the sprite and the boxcollider disappear for x amount of times. So far no problem. The problem is implementing when an enemy falls to the hole and so it simulates as if there is a ground so I can walk on top of him. I tried couple of things but with no success. The solution has to be with precise and quick. For example, there is 1 hole and 2 enemies that are very close to each other so if one fall to the hole, the other should walk over him even if the fallen enemy haven got to the bottom of the hole yet.
Anyone has a suggestion how to approach. I looked online but I did not find any good answer for that.
Answer by JxWolfe · Apr 06, 2017 at 03:34 PM
The way i would do it is have another block with the same properties as "Ground" and if the enemy falls into the ditch then delete him and make that "block" so other enemies think that he is a block not a ditch... you would need a collider trigger in that hole to check if someone fell in. I hope that helps
Your answer
Follow this Question
Related Questions
If i scale object, collision not working 2 Answers
Knockback effect in 2D. 1 Answer
AddForce problem axis X 1 Answer
When Player Collide with Cube, Cube changes to Rigidbody 2D 1 Answer