Search Unity

Question FMOD new instance flow is not working

Discussion in 'Audio & Video' started by Neoja, Mar 24, 2022.

  1. Neoja

    Neoja

    Joined:
    Mar 24, 2022
    Posts:
    5
    Hey,

    I'm trying to run some track in my game flow and stop it at the end,
    but I can run the sound just with RuntimeManager.PlayOneShot().
    I've tried to created an instance from the path and use the start() method.

    in the class:
    private FMOD.Studio.EventInstance _music;

    then I initialize the instance at Init():
    _music = RuntimeManager.CreateInstance("event:/Music");

    running it at the game base:
    _music.start();

    at the end method:
    _music.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
    _music.release();

    Warning:
    [FMOD] Instance of Event event:/Music has not had EventInstance.set3DAttributes() called on it yet!

    thanks.
     
    AldeRoberge likes this.
  2. DeadllySin00

    DeadllySin00

    Joined:
    Jul 11, 2019
    Posts:
    1
    _music.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes()

    Though you sure you need spatialized music?
     
  3. AldeRoberge

    AldeRoberge

    Joined:
    Jun 23, 2017
    Posts:
    60
    Make sure you don't have a spatializer on the FMOD event track :

    upload_2024-1-24_15-41-40.png

    This causes the audio track to be spatialized

    To the people who'll call me a necrobumper, I like googling things and finding the results, not empty threads.