The explosive barrel is a nice touch in any environment, but let's build something for a more specific application. What if we were to set a trap and have it spring when a character comes within a close enough proximity? Even better, a landmine in an open environment like a battlefield.
With that in mind, let's get to building a landmine that detonates when touched.
Open your IDE and start by creating a new class called
Landmine and have it extend from
Because our mine is an item that will probably be heavily used by a level designer, let's again hide many of the properties from the editor, as it will just clutter up the screen. Hide
We also ...