MINING QUEST: ‘Get Off The Rocks’ - Solutions

Quest: Mining Quest
Challenge: Get Off The Rocks

Feel free to share your solutions, ideas and creations below. If you get stuck, you can find some ideas here for completing this challenge.

Got this one as well. After finding a fitting method by googling, reading about Physics2D, and finding the “Rock” tag on the prefab the solution is quite short…

After an enemy is spawned I put the location in here:

Collider2D[] colliders = Physics2D.OverlapCircleAll(spawnLocation, 0.5f);
foreach (Collider2D collider in colliders)
{
    if (collider.CompareTag("Rock"))
    {
        Destroy(collider.gameObject);
    }
}
4 Likes

Privacy & Terms