Makinom - Game Toolkit for Unity
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • Extensions
    • API
  • Makinom 1
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get Makinom

Guide

Schematics

  • Setting the Player
  • Simple Character Controller
  • Mouse Orbit Camera
  • Random Waypoints

Breakout

  • Breakout Tutorial Introduction
  • 01 First Steps
  • 02 Player Controls
  • 03 Bricks
  • 04 Losing a Life
  • 05 UI Setup
  • 06 Sound Assignments

Space Shooter

  • Space Shooter Tutorial Introduction
  • 01 First Steps
  • 02 Player Move Controls
  • 03 Player Weapon Controls
  • 04 Hit and Destroy
  • 05 Asteroids
  • 06 Game Controller
  • 07 UI Setup
  • 08 Player’s Destruction
  • 09 Enemy Ship Mechanics
  • 10 Enemy Ship
  • 11 Moving the Background

Match 3

  • Match 3 Tutorial Introduction
  • 01 First Steps
  • 02 UI Setup
  • 03 Generating the Level
  • 04 Matching Jewels
  • 05 Destroying Jewels
  • 06 Game Controls
  • 07 Jewel Setup

Survival Shooter

  • Survival Shooter Tutorial Introduction
  • 01 First Steps
  • 02 Player Movement
  • 03 Player Shooting
  • 04 Enemy Mechanics
  • 05 Setting up the Enemies
  • 06 UI Setup
  • 07 Player’s Death
  • 08 Enemy Spawner

2D Roguelike

  • 2D Roguelike Tutorial Introduction
  • 01 First Steps
  • 02 Generating the Level
  • 03 Level Generation Machines
  • 04 Player Controls
  • 05 Walls, Food and Exit
  • 06 Game Manager and UI Setup
  • 07 Enemy Mechanics
  • 08 Game Over

2D Platformer

  • 2D Platformer Tutorial Introduction
  • 01 First Steps
  • 02 Player Movement
  • 03 Camera and Background
  • 04 Shooting Rockets
  • 05 Enemy Mechanics
  • 06 Setting up the Enemies
  • 07 Enemy Spawners
  • 08 Player Damage and Fall Remover
  • 09 Health Pickup
  • 10 Bomb Pickup
  • 11 Bomb Prefabs and Lay Bombs
  • 12 Pickup Spawner
  • 13 UI Setup
  • 14 Background Animations
  • Home
  • Guide
  • Tutorials
  • 2D Platformer
  • 10 Bomb Pickup

10 Bomb Pickup

Table of Contents
  • Bomb Pickup: Schematic
    • Is Payer
      • Check Object
    • Start Tagged Machine
      • Machine Object
      • Starting Object
      • Tag Settings
    • Change Variables
    • Play Sound At Point
      • Position
      • Audio Settings
    • Destroy Object
      • Destroy Object
  • Bomb Force: Schematic
    • Rigidbody Add Force
      • Rigidbody Object
      • Force Settings
      • Force
  • Bomb Explosion: Schematic
    • Settings
      • Machine Start Variables
      • Actors
      • Prefabs
    • Check Shape
      • Shape Settings
      • Hit Game Object
    • Start Machine
      • Machine Object
      • Starting Object
    • Start Tagged Machine
      • Machine Object
      • Starting Object
      • Tag Settings
    • Play Sound At Point
      • Position
      • Audio Settings
    • Change Position
      • Moving Object
      • Target Position
    • Emit Particles
      • Target Object
    • Spawn Prefab
      • Target Object
    • Destroy Prefab
    • Start Global Machine
      • Machine Object
      • Starting Object
    • Destroy Object

Setting up the bomb pickup and bomb explosion.

In this tutorial we’ll create the schematics to pick up bomb crates and exploding bombs.

Bomb Pickup: Schematic #

First, we’ll set up the bomb pickup schematic. The bomb crate works like the health crate – it will float down from the sky and land on the ground. When the player enters the trigger machine playing the schematic, he will get a defined number of bombs (object variable).

Open the Makinom editor, navigate to Schematics and create a new schematic. Change the following settings.

Is Payer #

Add Node > Game > Player > Is Player

First, we’ll check if the starting object is the player.

Check Object #

  • Object
    Select Starting Object.

Start Tagged Machine #

Add Node > Machine > Start Tagged Machine

In case it’s not the player, we try landing the crate.

This node is connected to the Failed slot of the Is Player node.

  • Share Local Variables
    Disable this setting.
  • Wait
    Enable this setting.

Machine Object #

  • Object
    Select Machine Object.

Starting Object #

  • Object
    Select Starting Object.

Tag Settings #

Click on Add Tag to add a starting tag.

  • Tag
    Set to land.

Change Variables #

Add Node > Value > Variable > Change Variables

We’ll use this node to add a bomb to the player’s bomb counter.

This node is connected to the Success slot of the Is Player node.

Click on Add Variable to add a variable change.

  • Change Type
    Select Variable.
  • Variable Key
    Set to bombs.
  • Variable Origin
    Select Global.
  • Type
    Select Int.
  • Operator
    Select Add.
  • Float Type
    Select Variable > Int Variable.
  • Variable Key
    Set to bombCount.
  • Variable Origin
    Select Object.
  • Object
    Select Machine Object.

Play Sound At Point #

Add Node > Audio > Audio > Play Sound At Point

We’ll use this node to play a taunt sound of the player.

Position #

  • Vector3 Type
    Select GameObject > Game Object.
  • Object
    Select Machine Object.
  • Value Origin
    Select Position.

Audio Settings #

  • Audio Clip
    Select Select Audio Clip and Player-IDefyYou.
    The audio clip can be found at Assets/Tutorial Resources/Audio/Player/Taunts/.
  • Wait
    Disable this setting.
  • Volume
    Set to 1 (Value).

Destroy Object #

Finally, we’ll destroy the crate’s game object from the root (in case it’s still hanging on the parachute).

Destroy Object #

  • Object
    Select Machine Object.
  • Use Root
    Enable this setting.

That’s it for the schematic – click on Save Schematic and save it as BombPickup in Assets/Schematics/.

Bomb Force: Schematic #

Next, we’ll create a schematic that will be used by the bomb’s explosion schematic to push enemies away from the bomb when it explodes.

Create a new schematic and change the following settings.

Rigidbody Add Force #

Add Node > Game Object > Rigidbody > Rigidbody Add Force

We can do this in one node by directly getting the direction and multiplying it by the force we want to apply.

Rigidbody Object #

  • Object
    Select Machine Object.

Force Settings #

  • Use 2D
    Enable this setting.
  • Continue Force
    Disable this setting.

Force #

  • Vector3 Type
    Select Game Object > Game Object Direction.
  • From Game Object
    Set to Starting Object.
  • To Game Object
    Select Machine Object.
  • Force Multiply
    Set to 100 (Value).

That’s it for the schematic – click on Save Schematic and save it as BombForce in Assets/Schematics/.

Bomb Explosion: Schematic #

Next, we’ll set up the bomb’s explosion schematic. The explosion will kill all enemies within a defined radius (local start variable).

Create a new schematic and change the following settings.

Settings #

We need a machine start variable (radius), 1 actor and 1 prefab.

Machine Start Variables #

Click on Add Start Variable to add a new variable.

  • Variable Key
    Set to radius.
  • Type
    Select Float.
  • Default Value
    Set to 10.

Actors #

We’ll use an explosion particle effect that’s already placed in the scene as actor. Actors are game objects that are already present in the scene – unline prefabs, we don’t need to spawn them.

Click on Add Actor to add an actor.

  • Type
    Select Find Object.
  • Search Type
    Select Name.
  • Search Name
    Set to explosionParticle.

Prefabs #

We’ll spawn a circle shaped prefab to show the explosion radius.

Click on Add Prefab Resource to add a prefab resource.

  • Name
    Set to Circle.
  • Prefab
    Select explosionCircle.
    The prefab can be found at Assets/Tutorial Resources/Prefabs/Pickups/.

Check Shape #

Add Node > Game Object > Raycast > Check Shape

We’ll use this node to get all enemies within a circle around the bomb.

Shape Settings #

  • Check All
    Enable this setting.
  • Single Objects
    Enable this setting.
  • Shape
    Select Circle 2D.

The Origin defines where the center of the circle is – it’ll be the bomb’s position.

  • Vector3 Type
    Select Game Object > Game Object.
  • Object
    Select Machine Object.
  • Value Origin
    Select Position.

The Radius defines the size of the explosion.

  • Float Type
    Select Variable > Float Variable.
  • Variable Key
    Set to radius.
  • Variable Origin
    Select Local.

The Layer Mask defines which layers we’ll check for objects.

  • Float Type
    Select Value > Layer Mask and the Enemies layer.

We’ll use Filter Game Objects to only use game objects tagged Enemy.

  • Use Filter
    Enable this setting.

Click on Add Object Check to add a filter.

  • Check Type
    Select Tag.
  • Name
    Set to Enemy.
  • Check Type
    Select Is Equal.
  • Is Valid
    Enable this setting.

Hit Game Object #

We need to use the found game objects in the next steps, so we’ll set them to the local selected data hitObject.

  • Use Hit Object
    Select Selected Data.
  • Data Key
    Set to hitObject.
  • Data Origin
    Select Local.
  • Change Type
    Select Set.

Start Machine #

Add Node > Machine > Start Machine

We’ll use this node to push away the enemies with the BombForce schematic.

This node is connected to the Success slot of the Check Shape node (i.e. we’ve found enemies in the explosion radius).

  • Schematic Asset
    Select BombForce.
  • Execution Type
    Select Single.
  • Update Type
    Select Update.
  • Share Local Variables
    Disable this setting.
  • Share Selected Data
    Disable this setting.
  • Wait Between
    Disable this setting.

Machine Object #

  • Object
    Select Selected Data.
  • Data Key
    Set to hitObject.
  • Data Origin
    Select Local.

Starting Object #

  • Object
    Select Machine Object.

Start Tagged Machine #

Add Node > Machine > Start Tagged Machine

We’ll use this node to kill the enemies by starting their tagged machine with the die tag.

  • Share Local Variables
    Disable this setting.
  • Wait Between
    Disable this setting.

Machine Object #

  • Object
    Select Selected Data.
  • Data Key
    Set to hitObject.
  • Data Origin
    Select Local.

Starting Object #

  • Object
    Select Machine Object.

Tag Settings #

Click on Add Tag to add a starting tag.

  • Tag
    Set to die.

Play Sound At Point #

Add Node > Audio > Audio > Play Sound At Point

We’ll use this node to play an explosion sound.

This node is connected to the Next slot of the previous node and the Failed slot of the Check Shape node (i.e. we didn’t find enemies, but the bomb still explodes).

Position #

  • Vector3 Type
    Select Game Object > Game Object.
  • Object
    Select Machine Object.
  • Value Origin
    Select Position.

Audio Settings #

  • Audio Clip
    Select Select Audio Clip and bigBoom.
    The audio clip can be found at Assets/Tutorial Resources/Audio/FX/.
  • Wait
    Disable this setting.
  • Volume
    Set to 1 (Value).

Change Position #

Add Node > Movement > Movement > Change Position

We’ll use this node to place the explosion particle actor at the bomb’s position.

Moving Object #

  • Object
    Select Actor 0.

Target Position #

  • To Object
    Enable this setting.
  • Object
    Select Machine Object.

Emit Particles #

Add Node > Game Object > Component > Emit Particles

We’ll use this node to start the explosion particle effect.

  • Emit
    Enable this setting.
  • Stop Before Start
    Enable this setting.

Target Object #

  • Object
    Select Actor 0: explosionParticle.
  • Scope
    Select Single.

Spawn Prefab #

Add Node > Game Object > Prefab > Spawn Prefab

We’ll use this node to spawn the circle prefab.

  • Prefab
    Select Prefab 0: Circle.
  • Target Type
    Select Object.

Target Object #

  • Object
    Select Machine Object.

Destroy Prefab #

Add Node > Game Object > Prefab > Destroy Prefab

We’ll use this node to destroy the circle prefab after 0.1 seconds.

  • Prefab
    Select Prefab 0: Circle.
  • Spawned Prefab ID
    Set to -1.
  • Destroy After Time
    Enable this setting.
  • Time (s)
    Set to 0.1 (Value).
  • Wait
    Disable this setting.

Start Global Machine #

Add Node > Machine > Start Global Machine

We’ll use this node to start the global machine handling the pickup spawning – we’ll set it up later, so just select the first global machine that we’ll use later. Exploding the bomb will result in the next pickup being spawned after some time.

  • Global Machine
    Select 0: Default.
  • Wait
    Disable this setting.

Machine Object #

  • Object
    Select Player.

Starting Object #

  • Object
    Select Player.

Destroy Object #

Add Node > Game Object > Game Object > Destroy Object

Finally, we’ll destroy the bomb – since we’ll also use this schematic on the bomb crate (which can explode when hit by a rocket), we’ll destroy the bomb from the root, in case the crate is still attached to the parachute.

  • Object
    Select Machine Object.
  • Use Root
    Enable this setting.

And that’s it for the schematic – click on Save Schematic and save it as BombExplosion in Assets/Schematics/.

The next tutorial will handle laying bombs and bomb prefabs.

Share This Article :
  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
Updated on January 7, 2021
Table of Contents
  • Bomb Pickup: Schematic
    • Is Payer
      • Check Object
    • Start Tagged Machine
      • Machine Object
      • Starting Object
      • Tag Settings
    • Change Variables
    • Play Sound At Point
      • Position
      • Audio Settings
    • Destroy Object
      • Destroy Object
  • Bomb Force: Schematic
    • Rigidbody Add Force
      • Rigidbody Object
      • Force Settings
      • Force
  • Bomb Explosion: Schematic
    • Settings
      • Machine Start Variables
      • Actors
      • Prefabs
    • Check Shape
      • Shape Settings
      • Hit Game Object
    • Start Machine
      • Machine Object
      • Starting Object
    • Start Tagged Machine
      • Machine Object
      • Starting Object
      • Tag Settings
    • Play Sound At Point
      • Position
      • Audio Settings
    • Change Position
      • Moving Object
      • Target Position
    • Emit Particles
      • Target Object
    • Spawn Prefab
      • Target Object
    • Destroy Prefab
    • Start Global Machine
      • Machine Object
      • Starting Object
    • Destroy Object
Sitemap
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • Extensions
    • API
  • Makinom 1 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get Makinom
  • Contact
  • Blog
  • ORK Framework
  • gamingislove.com
Categories
  • Makinom 1 (97)
    • Tutorial (97)
      • 2D Platformer (14)
      • 2D Roguelike (8)
      • Breakout (6)
      • How-to (34)
      • Match 3 (6)
      • Schematic (4)
      • Scripting (6)
      • Space Shooter (11)
      • Survival Shooter (8)
  • News (11)
  • Release (68)
Search

© 2015 Gaming is Love e.U.

Disclosure: This site may contain affiliate links, which means I may receive a commission if you click a link and purchase something that I have recommended. While clicking these links won’t cost you any money, they will help me fund my development projects while recommending great assets!