Moley is a minigame where the player has to destroy all the plants in the garden.
Each plant has a trigger zone and an array of plant piece prefabs. When the player enters the trigger zone, each piece is spawned and given a force to simulate a plant explosion and the plant is destroyed.
Originally the plant pieces could be pushed around by the player, but when there were a lot of pieces on the ground it became too chaotic and hard to see, so I removed the physics interactions between the player and plant pieces.
As the mole is underground, I added a particle system to the player to indicate the player's position. I added a different particle effect when a plant is destroyed to simulate digging up the plant.
The destruction percentage is tracked and displayed to the player so they know how much of the garden they have destroyed. I added edge cases for 0% and 100% to correctly display the percentage.