I’m extremely new to the world of game audio, but am a composer.
I’m working with unity on a simple platformer game.
I’m trying to write a script for emitting an event in fmod and adjusting a parameter, but can’t even get the event to play in unity. I do have a studio listener but I’m still getting nothing. If someone can please help me! My script as follows:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MusicController : MonoBehaviour
{
private FMOD.Studio.EventInstance music;
[FMODUnity.EventRef]
public string fmodEvent;
[SerializeField]
[Range(0f, 20f)]
private float intensity;
void Start()
{
music = FMODUnity.RuntimeManager.CreateInstance("event:/gameplay music");
music.start();
}
void Update()
{
music.setParameterByName("Intensiy", intensity);
}
}