Documentation & Tutorials
  • Pivec Labs Documentation & Tutorials
  • Assets for Game Creator 1
    • Action Pack 1
      • Action List
        • Misc Actions
        • Object Actions
        • TMP Actions
      • Examples
        • Example 1 TMP
        • Example 2 Objects
        • Example 3 Actions
    • Action Pack 2
      • Action List
        • Camera Actions
        • Graphics Actions
        • Audio Actions
        • Video Actions
      • Triggers
      • Components
      • Examples
        • Example 1 - Camera
        • Example 2 - Camera FPS
        • Example 3 - Graphics
        • Example 4 - Sounds
        • Example 5 - Audio Player
        • Example 6 - Video Player
    • Action Pack 3
      • Action List
        • Day/Night Cycle
        • Light Control
      • Components
      • Examples
        • Example 1 - Day Night Cycle
        • Example 2 - Light Control
    • Accessibility Module
      • Components
      • Setup
      • Auditory Aids
        • Closed Captions for Sounds
        • Volume Control with Tags
        • Multiple Volume Controls
      • Motoric Aids
        • Configurable Tank Camera
        • On-Screen Multi-Function Joystick
        • Dynamic Touchstick
        • Multi-Function Touchstick
      • Cognitive Aids
        • Parental Controls with Password
        • Dyslexia Font Options
        • Motion Sickness Prevention
        • Gameplay Speed and Sensitivity
      • Visual Aids
        • Colour Picker
        • Variable Text Size
        • Object Outlining
        • Colour Switching
        • Colour Correction
    • Mobile Components
      • Actions
        • Haptics
        • Camera
        • TouchSticks
        • Gyroscope
        • Utilities
      • Triggers
        • Touch Gestures
      • Conditions
      • Components
      • Prefabs
      • Examples
        • Example 1 Haptics
        • Example 2 Cameras
        • Example 3 Gestures
        • Example 4 Controls
        • Example 5 Steering Wheel/Pedals
        • Example 6 Gyroscope Controls
        • Example 7 Gyroscope Camera
        • Example 8 Utilities
        • Example 9 AutoRun
      • Extras
    • UI Components
      • Canvas Components
        • Canvas Animations
        • 3D Models on a Canvas
        • Video on a Canvas
      • Animating UI Elements
        • Cross Fade Elements
        • Slide Elements
        • Shake UI Element
        • Tooltips
      • Text Mesh Pro & uGUI Text
      • Colour Picker Component
      • Mini Map Component
        • MiniMap QuickStart
        • Fullscreen Map
        • Adding Markers
        • Adding Labels
      • System Info Panel
        • SysInfo Quickstart
        • Using SysInfo Toggle
      • Main Menu Templates
        • Customising the Prefabs
        • Load/Save System
        • Comic Strip Example
    • Developer Tools
      • Time Manager
        • Actions & Conditions
      • Waypoint System
      • Click to Spawn Objects
      • In-Game Console
      • In-Game Screen Capture
    • Turn Based Module
    • VR Module GC1
  • Assets for Unity
    • Developer Tools for Unity
      • Click to Spawn
      • In-Game Screen Capture
      • In-Game Console
    • Mini Map System
      • MiniMap Quickstart
      • Map Parameters
      • Adding Makers
  • Tutorials
    • Tutorials for Game Creator 1
      • Installing and Updating Modules
      • Adding Actions to the Button Bar
      • Changing the Graphics for TouchStick
      • Adding Passwords to Player Actions
      • Using the Colour Picker with Variables
      • Creating a 3D Inspection Panel for Game Objects
      • Customising the UI MiniMap
      • Creating a toggle for the SysInfo Panel
      • Simple Player Run on Left Shift Down
      • Pan Follow Camera with Keyboard
    • Tutorials for Unity
  • ANNEX
    • Roadmap
    • FAQ
Powered by GitBook
On this page

Was this helpful?

  1. Assets for Game Creator 1
  2. Action Pack 2
  3. Examples

Example 5 - Audio Player

PreviousExample 4 - SoundsNextExample 6 - Video Player

Last updated 4 years ago

Was this helpful?

This Audio Player example has been set up using a World Space Canvas, however it will work the same using a screen space canvas, but the UI elemsnts will need to be scaled differently.

Apart from moving the player to the marker, all Actions take place on the Canvas, or more specifically the Canvas UI Elements. We have used Game Creator UI Buttons to execute these actions, and a GC Slider, although it will work with a standard Unity Slider.

Firstly we have added a Unity Audio Source Object to the Canvas Plane and added a sound clip.These Actions work on Audio Source Objects and not GC Play sound Actions. We have three GC Buttons. Each calls an Action Pack 2 Action, Play, Pause, and Stop respectively.

However, on the Play Button, we have also added the Scrub Action. Both the Play and Scrub Actions can also display the Duration of the Audio (added on the Play Action) and the Current time (added on the Scrub Action). Within the Play and Scrub Actions, you add the Audio Source Object, and on the Scrub Action you add ethe Slider element.

Then press Play to start the Audio, and drag the Slider to advance the Audio.

We have also added a Visualizer that has been included in this Action Pack. This component is not controlled by Actions, but could be turned on and off with the Set Active Action within GC.

  1. Add a Game Object to the Canvas and add the Audio Visualizer script from the Action Pack 2 Component folder.

  2. Add a series of images and add the Audio Visualizer Object script to each (this is an empty script, just used for identification).

  3. Withing the Audio Visualizer Script, add the Audio Source object from the canvas, set the clor, the range and the sensitivity.

  4. Press play and readjust the settings to fit.