- Home /
How to make a piece of image disappear?
I don't know if that's the common method to do that but I'm working on a 2D game and I want my character to throw grenades. I want a particular circular area of the ground to be disappeared where my nade stops bouncing and take its final position. How's that going to work? Thanks in advance.
Answer by Kiloblargh · Dec 05, 2013 at 07:51 PM
You're facing a lot more work than "make a piece of image disappear," and it sounds like you haven't thoroughly thought over the problem or what you want to happen. Destroyable terrain is a tricky problem in general, but it's been done a lot and discussed a lot and there is more than one way to achieve it.
Without more specifics of your game, it's hard to give advice. So I can only really answer your question with more questions: Is the game tile-based? Is this a simple retro 80s Bomberman / Lode Runner kind of game? Or were you picturing an effect like in Worms? Or more realistic than that? Will the character be able to walk in the crater? Does the ground need to fill in/drop down if your grenade undermines it? Does your walking and grenade throwing use the physics engine?
Well, I was thinking of a game like worms. It doesn't need to be very realistic so I'm only looking for a simple destruction without using physics engine. And yes I want my character to be able to walk in the crater. So I think I need to shape my mesh collider through scripts in run-time. Is it easier to destroy Unity's terrain or a simple foreground image? I don't need a bunch of code lines. I'm only looking for a way to do such a thing.