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

Schematics

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

Breakout

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

Space Shooter

12
  • 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

8
  • 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

9
  • 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

9
  • 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

15
  • 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
  • Breakout
  • 06 Sound Assignments
View Categories

06 Sound Assignments

4 min read

Setting up sound types and assignments.

In this tutorial we’ll use Sound Types and Sound Assignment components to play different audio clips when the ball hits game objects. You can learn more about this in the audio and music documentation.

Setting up the Sound Type and Template #

First, we’ll set up the sound type that we’ll use. Open the Makinom editor and navigate to Base/Control > Sound Types.

Sound Type 0: Hit #

There’s already a Default sound type added, we’ll just rename it.

  • Name
    Set to Hit.

Sound Templates 0: Hit Wall #

Navigate to Templates > Sound Templates and select the Default template. Change the following settings.

  • Name
    Set to Hit Wall.

Click on Add Sound.

  • Sound Type
    Select Hit.
  • Audio Clip
    Select hit_wall.

Sound Templates 1: Hit Brick #

Add a new sound template and change the following settings.

  • Name
    Set to Hit Brick.

Click on Add Sound.

  • Sound Type
    Select Hit.
  • Audio Clip
    Select hit_brick.

That’s it – click on Save Settings to save the changes.

Hit Sound: Schematic #

Now, we’ll create a schematic that’ll be attached to the Ball that plays the sound type when colliding with other game objects.

Navigate to Schematics, create a new schematic and change the following settings.

Play Sound #

Add > Audio > Audio > Play Sound

We’ll use this node to play the Hit sound type on the game object that was hit (i.e. the starting object).

Depending on the audio clip that’s assigned to the sound type on the game object (using a Sound Assignment component), a different sound will be played.

Play On #

  • Object
    Select Starting Object.

Audio Settings #

  • Use Sound Type
    Enable this setting.
  • Sound Type
    Select Hit.
  • Wait
    Disable this setting.
  • Play One Shot
    Enable this setting.
  • Volume
    Set to 1.

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

Hit Sound: Collision Machine #

Next, we’ll add the HitSound schematic to the Ball game object (child object of the Paddle game object) in the scene using a Collision Machine.

Select the Ball game object and add a collision machine component (e.g. using the component menu: Makinom > Machines > Collision Machine). Change the following settings.

Start Settings #

  • Collision Enter
    Enable this setting.
  • Start By Other (Starting Objects)
    Enable this setting.

Machine Execution Settings #

  • Schematic Asset
    Select HitSound.
  • Execution Type
    Select Single.
  • Update Type
    Select Update.

Don’t forget to apply the changes to the prefab by pressing on Overrides > Apply All (top of the inspector when the Paddle game object is selected).

Sound Assignments #

We’ll now assign audio clips to the Hit sound type on different game objects using Sound Assignment components.

Paddle, Wall (x2), Roof #

We’ll assign the Hit Wall sound template to the Paddle game object, the 2 Wall game objects (child objects of the Level game object) and the Roof game object (also child object of the Level game object).

Add a sound assignment component to the game objects (e.g. using the component menu: Makinom > Scenes > Sound Assignment) and change the following settings.

  • Sound Template
    Select Hit Wall.

Don’t forget to apply the changes to the Paddle game object to update the prefab.

Bricks #

Finally, we’ll assign the Hit Brick sound template to the 3 brick prefabs (Brick 1, Brick 2 and Brick 3 – the prefabs can be found at Assets/Tutorial Resources/Prefabs/).

Add a sound assignment component to the prefabss (e.g. using the component menu: Makinom > Scenes > Sound Assignment) and change the following settings.

  • Sound Template
    Select Hit Brick.

And that’s it – don’t forget to save the scene.

Testing #

Hit Play to test the game. Now, the ball will play sounds when colliding with the paddle, walls, roof and the bricks (which you’ll only hear for bricks that aren’t destroyed by the hit).

This concludes the breakout game tutorial series. You can add additional content to the game, e.g. new levels, harder bricks (increasing the health) or random brick placement (using a schematic that spawns bricks by chance).

Share This Article :
  • Facebook
  • X
  • LinkedIn
  • Pinterest
Updated on December 16, 2020
Table of Contents
  • Setting up the Sound Type and Template
    • Sound Type 0: Hit
    • Sound Templates 0: Hit Wall
    • Sound Templates 1: Hit Brick
  • Hit Sound: Schematic
    • Play Sound
      • Play On
      • Audio Settings
  • Hit Sound: Collision Machine
    • Start Settings
    • Machine Execution Settings
  • Sound Assignments
    • Paddle, Wall (x2), Roof
    • Bricks
  • Testing
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 (82)
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!