ORK Framework Logo - RPG Editor for Unity
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK

Status System Setup

  • START Status System Setup
  • 01 Status Values
  • 02 Status Development
  • 03 Attack/Defence Modifiers
  • 04 Status Effects
  • 05 Formulas
  • 06 Ability & Item Types
  • 07 Abilities Part 1: Attacks
  • 08 Abilities Part 2: Support & Sabotage
  • 09 Abilities Part 3: Elemental Magic
  • 10 Items
  • 11 Equipment Part 1: Slots & Slot Set Templates
  • 12 Equipment Part 2: Weapons
  • 12.5 (Optional) Equipment Part 2.5: Weapons
  • 13 Equipment Part 3: Shields, Armor & Accessories
  • 13.5 (Optional) Equipment Part 3.5: Shields, Armor & Accessories
  • 14 Equipment Part 4: Available Equipment Templates
  • 15 Loot
  • 16 Battle AIs
  • 17 Combatants Part 1: General Settings
  • 18 Combatants Part 2: Players
  • 19 Combatants Part 3: Enemies
  • 20 Combatant Groups
  • END Status System Setup

3D RPG Playground

  • START 3D RPG Playground
  • 01 Player Setup
  • 02 Start Menu
  • 03 First Interaction
  • 04 Music
  • 05 Areas
  • 06 Collecting Items
  • 07 Displaying Equipment
  • 08 Combatant Prefabs, Icons & Portraits
  • 09 Combatant Animations
  • 10 Camera Positions
  • ANIM 01 Battle Start/End Schematics
  • ANIM 02 Use, Cast & Camera
  • ANIM 03 Abilities & Items
  • ANIM 04 Physical Attacks
  • ANIM 05 Special Actions
  • BATTLE 01 Battle Menu
  • BATTLE 02 Prepare for Battle
  • TURN 01 Turn Based Setup
  • TURN 02 Turn Order HUD
  • ATB 01 Active Time Setup
  • ATB 02 Cast Times
  • ATB 03 Timebar HUD
  • BATTLE 03 The First Battle
  • BATTLE 04 Hunting Move AI
  • BATTLE 05 Spawning Combatants
  • 11 Save Games
  • MENU 01 UI Boxes
  • MENU 02 Template HUDs
  • MENU 03 Overview Menu
  • MENU 04 Menu Screens
  • 12 Shop
  • BATTLE 06 Random Battles
  • DUNGEON 01 Enter the Dungeon
  • DUNGEON 02 The Trapdoor
  • DUNGEON 03 Enemies on Level 1 & 2
  • DUNGEON 04 Traps on Level 3
  • DUNGEON 05 Going Deeper
  • 13 Bestiary (+MENU+ANIM)
  • QUEST 01 Hunting Quests (+MENU)
  • QUEST 02 Guard NPC
  • QUEST 03 Forest Ruin Cheese
  • QUEST 04 Witch NPC with Cheese
  • QUEST 05 Quest Mark HUDs
  • 14 Research Trees (+MENU)
  • CRAFT 01 Crafting Materials
  • CRAFT 02 Crafting Recipes
  • CRAFT 03 Crafting Menu
  • CRAFT 04 Crafting Proficiency & Critical Crafting
  • CRAFT 05 Materials Loot
  • 15 Changing Choice Dialogue
  • 16 Follow Me!
  • BATTLE 07 Sequence Loot Dialogue

3D Action RPG

  • START 3D Action RPG
  • 01 Status System Setup
  • 02 Player Setup
  • 03 Player Weapon
  • 04 Player Attacks
  • 05 Enemy: Chomper
  • 06 Chomper Attack
  • 07 Hit & Death
  • 08 HUDs
  • 09 Rolling on the Floor
  • 10 Enemy: Spitter
  • 11 Spit Attack
  • 12 Potion
  • 13 Grenade
  • 14 Item HUD
  • 15 Enemy: Grenadier
  • 16 Grenadier Melee Attacks
  • 17 Grenadier Flamethrower
  • 18 Item Drops
  • END 3D Action RPG

2D Grid Battle RPG

  • START 2D Grid Battle RPG
  • 01 Player Setup
  • 02 Prefab & Music Setup
  • 03 Randomizing Combatants
  • 04 UI Setup
  • 05 Battle Start, End & Phase Schematics
  • 06 Battle System Setup
  • 07 Battle Grid Setup
  • 08 Grid Move
  • 09 Forest Battle Grid
  • 10 Battle AI
  • 11 Ability Ranges
  • 12 Death & Use Schematics
  • 13 Attack Schematic
  • 14 Shoot Schematics
  • 15 Battle Selection Interaction
  • END 2D Grid Battle RPG

Schematics

  • Simple Start Schematic
  • Battle Start Schematic
  • Battle End Schematic
  • Moving to Target and Back
  • Animating a Base Attack
  • Animating a Magic Ability
  • Grid Movement
  • Open and Close UI Animations
  • Flying Text Mover

UI Setups

  • Unity UI: Initial Setup
  • Unity UI: TextMesh Pro Setup
  • Unity UI: UI Box
  • Unity UI: Flying Text
  • Unity UI: Dragging Notification
  • Unity UI: Interaction HUD
  • Unity UI: Simple Player HUD
  • Unity UI: Quest HUD
  • Unity UI: Shortcuts HUD
  • Unity UI: Currency HUD
  • Unity UI: Tooltip HUD
  • Unity UI: Control HUD
  • Unity UI: Attack Modifiers
  • Unity UI: Defence Modifiers

Gameplay Bits

  • Combining Input Origins
  • Combining Status Value Flying Texts
  • Fun With Flying Text
  • HUD Effects With Conditional Schematics
  • Inventory Containers
  • Multi Interaction Controllers
  • World Space HUD
  • World Space Dialogue
  • Home
  • Guide
  • Tutorials
  • 3D RPG Playground
  • 04 Music

04 Music

Table of Contents
  • Music Setup
    • 0: Town Theme
    • 1: Forest Theme
    • 2: Battle Theme
      • Loop Settings
    • 3: Victory Theme
    • 4: Outpost Theme
    • 5: Dungeon Theme
    • 6: Boss Battle Theme
      • Loop Settings
  • Scene Setup
    • Start Menu
    • Dungeon Level 1 - 5
    • World
      • Town
      • Outpost
    • Forest
  • Testing
  • (Optional) Organizing the scene

In this tutorial we’ll add music to the game.

It doesn’t matter if you want to add actual music or just some environmental tracks – your game needs some noice!

We’ll set up multiple music clips and add some of them to the game world, while others will be used later (e.g. battle and victory music).

Learn more about music in this Makinom documentation.

Music Setup #

Navigate to Game > Music, we’ll change the Default music and add additional music.

You can find all the music audio clips in Assets/Tutorial Assets/Audio/Music/cynicmusic – in case you want to check out other tracks from the same composer, check out cynicmusic’s other assets on opengameart.org. Most of them are available under CC0 license.

0: Town Theme #

  • Name
    Set to Town Theme.
  • Audio Clip
    Select TownTheme.
  • Loop Clip
    Enable this setting.

1: Forest Theme #

  • Name
    Set to Forest Theme.
  • Audio Clip
    Select GameMusic_ForestTheme_24.
  • Loop Clip
    Enable this setting.

2: Battle Theme #

  • Name
    Set to Battle Theme.
  • Audio Clip
    Select battleThemeA.

Loop Settings #

We’ll use a loop within the track, i.e. at a certain position we’ll change the playback position back to a previous one.

Click on Add Loop.

  • Use PCM
    Enable this setting.
  • Check PCM
    Set to 4086000.
  • Set PCM
    Set to 607000.

You can test loops directly in the editor via the Test Loop button. The Game view has to be unmuted for this to work.

3: Victory Theme #

  • Name
    Set to Victory Theme.
  • Audio Clip
    Select Heavy_ConceptB.
  • Loop Clip
    Disable this setting.
    The victory theme should only play once.

4: Outpost Theme #

  • Name
    Set to Outpost Theme.
  • Audio Clip
    Select 025_A_New_Town.
  • Loop Clip
    Enable this setting.

5: Dungeon Theme #

  • Name
    Set to Dungeon Theme.
  • Audio Clip
    Select song18.
  • Loop Clip
    Enable this setting.

6: Boss Battle Theme #

  • Name
    Set to Boss Battle Theme.
  • Audio Clip
    Select battleThemeB.

Loop Settings #

Click on Add Loop.

  • Use PCM
    Enable this setting.
  • Check PCM
    Set to 2868000.
  • Set PCM
    Set to 0.

That’s it for the music setup.

Don’t forget to save your changes by clicking on Save Settings at the bottom of the editor.

Scene Setup #

We’ll add our music to the game using Music Player components.

You can add them either via the scene hierarchy context menu (Makinom > Music Player) or the Makinom scene wizard (Create Game Object > Music Player).

There are different variations available:

  • Music Player
    Creates a music player that plays the music on Start, e.g. when the scene is loaded.
  • Music Player 2D
    Creates a music player that plays the music when the player enter’s the 2D trigger of the music player.
  • Music Player 3D
    Creates a music player that plays the music when the player enter’s the 3D trigger of the music player.

We’ll use the start and 3D trigger variations.

Start Menu #

Let’s start with the Start Menu scene (Assets/Scenes/) – open the scene and add a Music Player (i.e. not 2D or 3D variants) using the context menu or scene wizard.

Change the following settings in the Music Player component.

  • Play Type
    Select Stop.

The start menu will stop any playing music when we return to it.

Dungeon Level 1 – 5 #

For the Dungeon Level 1 to Dungeon Level 5 scenes (not the Dungeon Battle Arena), we’ll also use the Music Player that plays automatically. The dungeon scenes can be found in Assets/Scenes/Dungeon/.

  • Play Type
    Select Fade Out Play.
    This’ll fade out the current music and play the music player’s track afterwards.
  • Music Clip
    Select Dungeon Theme.
  • Fade Time
    Set to 1.
  • Interpolation
    Select Linear.

The setup is the same for all 5 levels, so you can either copy/pase the game object or create a prefab out of it and use that.

World #

Open the World scene (Assets/Scenes/), this time we’ll use the Music Player 3D, which has a Sphere Collider added, used as a trigger.

We need to place multiple music players to play our town theme, forest theme and outpost theme. The forest theme will be added multiple times, to cover playing it when leaving town, the dungeon and the outpost. Remember how the scene looks like:

Town #

Add the music player to the town are and increase the Radius of the Sphere Collider to cover a large part of the town – at least the spawn point and part of the bridge should be covered. I’m using a radius of 60.

For better organization, change the game object’s name to Music Player Town.

As for the Music Player component:

  • Play Type
    Select Fade Out Play.
  • Music Clip
    Select Town Theme.
  • Fade Time
    Set to 1.
  • Interpolation
    Select Linear.

We’ll also add a condition to it, we don’t want to use the music player while being in battle – otherwise we accidentally change the music when intersecting with the music player’s trigger.

In the Music Player‘s Condition Settings:

Click on Add Condition.

  • Condition Type
    Select Game State.

Click on Add Game State.

  • Condition Type
    Select Game State.
  • Game State
    Select In Battle.
  • Check State
    Select Inactive.

Outpost #

Add the music player to the outpost area and increase the Radius of the Sphere Collider to cover the outpost, mainly the entrance. I’m again using a radius of 60.

Change the game object’s name to Music Player Outpost.

As for the Music Player component:

  • Play Type
    Select Fade Out Play.
  • Music Clip
    Select Outpost Theme.
  • Fade Time
    Set to 1.
  • Interpolation
    Select Linear.

We need to add the game state condition to the Condition Settings again.

Click on Add Condition.

  • Condition Type
    Select Game State.

Click on Add Game State.

  • Condition Type
    Select Game State.
  • Game State
    Select In Battle.
  • Check State
    Select Inactive.

Forest #

We’ll add multiple music players for the forst, first, let’s add one at the outpost, since we’re already in that area. A radius of 10 is enough this time, place it at the outpost’s exit.

Change the game object’s name to Music Player Forest Outpost.

As for the Music Player component:

  • Play Type
    Select Fade Out Play.
  • Music Clip
    Select Forest Theme.
  • Fade Time
    Set to 1.
  • Interpolation
    Select Linear.

We need to add the game state condition to the Condition Settings again.

Click on Add Condition.

  • Condition Type
    Select Game State.

Click on Add Game State.

  • Condition Type
    Select Game State.
  • Game State
    Select In Battle.
  • Check State
    Select Inactive.

Copy the game object and move it to the dungeon entrance. Make sure it’s also placed at the correct height.

Change the game object’s name to Music Player Forest Dungeon.

Copy the game object and move it to the town’s exit. Make sure it’s also placed at the correct height.

Change the game object’s name to Music Player Forest Town.

Testing #

And that’s it – save the scene.

Hit play and you’ll now hear the town theme when spawning, switching to the forest theme when leaving town, etc.

Next, we’ll set up areas.

(Optional) Organizing the scene #

For even better organizition of your scene, add an empty game object, rename it to Music and parent all music players to it.

Keeping your scenes tidy and uncluttered is always a good idea.

Share This Article :
  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
Updated on December 17, 2021
Table of Contents
  • Music Setup
    • 0: Town Theme
    • 1: Forest Theme
    • 2: Battle Theme
      • Loop Settings
    • 3: Victory Theme
    • 4: Outpost Theme
    • 5: Dungeon Theme
    • 6: Boss Battle Theme
      • Loop Settings
  • Scene Setup
    • Start Menu
    • Dungeon Level 1 - 5
    • World
      • Town
      • Outpost
    • Forest
  • Testing
  • (Optional) Organizing the scene
Sitemap
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (59)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (129)
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!