Hi, when i walk through my trigger box, i took some code that would handle updating the parameter and changed the ‘function names’ according to my project. Unity confirms that the player goes through the box, i don’t know if it updates the value but the music doesn’t change at all. i made a parameter such that “Tension” could be increased from 0 to 1 to switch between 3 different background music tracks. i’m all out of ideas and googling didn’t help. thank you for your time.
The set up is as follows:
Player contains the fmod studio event emitter and listener.
Cube that is supposed to act as a transition has a “Parameter set by name” script that changes the value of the parameter in fmod after exiting.
fmod version 2.00.10 (in unity too)
the script of parameter by name is:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ParametersSetByName : MonoBehaviour
{
FMOD.Studio.EventInstance MainMusic;
private void Start()
{
MainMusic = FMODUnity.RuntimeManager.CreateInstance("event:/MainMusic");
MainMusic.start();
}
private void OnTriggerExit(Collider other)
{
if (other.name == "Player")
MainMusic.setParameterByName("Tension", 1.0f, true); //true to fade with defined seek speed in fmod.
Debug.Log("exit box");
}
}
the event path is correct because i copied it from fmod itself.
the console returns the debug statement when exiting, so it does recognize the collider.
in the console i also get this message: [FMOD] Instance of Event event:/MainMusic has not had EventInstance.set3DAttributes() called on it yet!
UnityEngine.Debug:LogWarningFormat(String, Object[])
FMODUnity.RuntimeManager:Update() (at Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs:433)
here is a link to what the timeline and parameter looks like