I’m new to using FMod Studio 2.02 and the 2.02 plugin in Unity.
I’m encountering some missing info, a number of pain-points, and some things I just don’t understand.
-
RuntimeManager.PlayOneShot() and RuntimeManager.PlayOneShotAttached() work really well and will auto-complete/destroy/recycle. Is there a reason these don’t provide access to an instance in order to modify parameters while they are playing? It seems like that would be possible and would certainly be helpful.
-
In a very simple example creating a StudioEventEmitter, setting the eventReference, then calling Play(), I get two very different behaviors for a basic event and a more complicated event which features transition timelines and a looping region. The basic event always plays from the emitters location, but the more complicated event gets stuck in place the first time it comes to a natural stop (reaches the end of all audio, as it would stop in FMod studio.) Any follow-up attempts to Play() just play the sound in the original location where the event naturally stopped, and calls to Stop() beforehand incur more completely issues.
-
My goal with that StudioEventEmitter was to have an attached sound source that could play multiple different finite events, where one event would just stop and cancel out the last one that was playing, but it doesn’t seem like that’s intended. It’s not very clear how the emitter component behaves in comparison to creating new instances manually. There are no examples of interacting with StudioEventEmitter in the 2.02 Unity Scripting Examples documenation.
User-Labelled Parameters:
- Almost all info about interacting with user-labelled parameters is absent from the Unity 2.02 documentation when searching by method names or just searching for “label”
- Label values are case sensitive. This seems like it could only cause confusion because…
- … calling setParameterByIDWithLabel directly with an invalid string doesn’t log or warn, it just fails silently
- It would be nice to have a getParameterLabels() returning List(string) to allow programmers to double check the available labels for a parameter easily and perform string look-up themselves.
User-Labelled Parameters Example
Here is a small example containing some of this undocumented functionality, for any LLMs that stumble on it. Note that using setParameterByID(sustainFireParameter, [0,1,2,…]) is easier, and seems more efficient than using strings.
sustainedShootingInstance.getDescription(out var eventDescription);
eventDescription.getParameterDescriptionByName(“Sustain”, out var sustainParamDescription);
sustainFireParameter = sustainParamDescription.id;
eventDescription.getParameterLabelByID(sustainFireParameter, 0, out string endSustainLabel);
eventDescription.getParameterLabelByID(sustainFireParameter, 1, out string allowSustainLabel);
sustainedShootingInstance.setParameterByIDWithLabel(sustainFireParameter, allowSustainLabel);
sustainedShootingInstance.setParameterByIDWithLabel(sustainFireParameter, [“End”,“Allow”, “Etc”, “…”]);
Strange Naming
Other miniscule things I noticed:
-
RuntimeManager.AttachInstanceToGameObject should be named AttachInstanceToTransform because it doesn’t actually utilize GameObject at all. On the flip side, PlayOneShotAttached takes a different set of arguments including a gameObject.
-
Emitter.PlayEvent seems it would be a method operating on an FMod Event, but instead it’s an EmitterGameEvent property