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
  • Match 3
  • 05 Destroying Jewels

05 Destroying Jewels

Table of Contents
  • Destroy Jewel: Schematic
    • Settings
      • Prefabs
    • Change Color
      • Game Object
    • Wait
    • Spawn Prefab
      • Target Object
    • Destroy Prefab
    • Play Sound (Channel)
    • Wait
    • Change Variables
    • Destroy Object
      • Destroy Object

Setting up the schematic to handle the destruction of a jewel.

In this tutorial we’ll create the schematic that’s started (by a tagged machine on the individual jewels) when a jewel is destroyed. It’ll handle animating the destruction (blinking and spawning a particle effect), increasing the player’s score (the points of each jewel are stored in an object variable on the jewel) and destroying the game object.

In case you want to add special jewels (e.g. destroying a whole row/column or all nearby jewels), this is where you’d add the functionality, either directly in this schematic or creating new schematic and using them in the tagged machine on the jewel.

Destroy Jewel: Schematic #

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

Settings #

We need a prefab resource for the particle effect.

Prefabs #

Click on Add Prefab Resource to add a prefab resource.

  • Prefab
    Select Destroy Particles.
    The prefabs can be found at Assets/Tutorial Resources/Prefabs/.
  • Use Pooling
    Enable this setting.

Change Color #

Add Node > Game Object > Renderer > Change Color

We’ll use this node to start blinking the object by fading it’s alpha (color) value.

  • Color Type
    Select Renderer.
  • Fade
    Select Blink.
  • Wait
    Disable this setting.
  • Time (s)
    Set to 0.25 (Value).
  • Fade Alpha
    Enable this setting.
  • Fade Red/Green/Blue
    Disable these settings.
  • Start Color
    Set to R=0, G=0, B=0, A=255.
    Depending on the used color picker range, this can also be A=1, you basically want a full alpha value color.
  • End Color
    Set to R=0, G=0, B=0, A=0.

Game Object #

  • Object
    Select Machine Object.

Wait #

Add Node > Base > Wait

We’ll wait for 0.5 seconds to give the game object some time for blinking.

  • Time (s)
    Set to 0.5 (Value).

Spawn Prefab #

Add Node > Game Object > Prefab > Spawn Prefab

Now, we’ll spawn the particle effect.

  • Prefab
    Select Prefab 0: Destroy Particles.
  • Target Type
    Select Object.

Target Object #

  • Object
    Select Machine Object.

Destroy Prefab #

Add Node > Game Object > Prefab > Destroy Prefab

Next, we’ll destroy the particle effect (after 1 second).

  • Prefab
    Select Prefab 0: Destroy Particles.
  • Spawned Prefab ID
    Set to -1.
    This will destroy all spawned instances of the prefab.
  • Destroy After Time
    Enable this setting.
  • Time (s)
    Set to 1 (Value).
  • Wait
    Disable this setting.

Play Sound (Channel) #

Add Node > Audio > Audio > Play Sound

We’ll play a destruction sound.

  • Audio Clip
    Select Select Audio Clip and destroy_jewel.
    The audio clip can be found at Assets/Tutorial Resources/Audio/.
  • Wait
    Disable this setting.
  • Play One Shot
    Disable this setting.

Wait #

Add Node > Base > Wait

We’ll wait for 0.25 seconds for the particle effect and audio to play a bit before destroying the game object. Also, this allows the blinking to fade from full alpha to no alpha (due to blink duration of 0.25 and already having waited for 0.5 seconds).

  • Time (s)
    Set to 0.25 (Value).

Change Variables #

Add Node > Value > Variable > Change Variables

We’ll use this node to increase the player’s score (global int variable) by the points of the jewel (object int variable on the jewel).

Click on Add Variable to add a variable change.

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

Destroy Object #

Add Node > Game Object > Game Object > Destroy Object

Finally, we’ll destroy the machine object (jewel).

Destroy Object #

  • Object
    Select Machine Object.

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

The next tutorial will handle the game controls.

Share This Article :
  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
Updated on December 19, 2020
Table of Contents
  • Destroy Jewel: Schematic
    • Settings
      • Prefabs
    • Change Color
      • Game Object
    • Wait
    • Spawn Prefab
      • Target Object
    • Destroy Prefab
    • Play Sound (Channel)
    • Wait
    • Change Variables
    • Destroy 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!