
In the second method a new EventInstance is created, started and released immediately so that when the instance finishes playing it is freed from memory. "event:/example", converts the string to a Guid and passes it to the second PlayOneShot method. The first method takes the string you provide as the path argument, i.e. t3DAttributes(RuntimeUtils.To3DAttributes(position)) Public static void PlayOneShot(Guid guid, Vector3 position = new Vector3()) Let’s look at the PlayOneShot methods in RuntimeManager.cs: public static void PlayOneShot(string path, Vector3 position = new Vector3())ĭebug.LogWarning(" Event not found: " + path)
#Unity audio overload code#
If you use Steal Quietest / Furthest, only 5 torches closest to the starting position will be audible, the rest are stolen (aka stopped) and will not become audible when approached.This is a question that is asked numerous times: can parameters be set when calling the PlayOneShot helper method of the FMOD Unity integration? Indeed, this can be done by slightly modifying the source code of the FMOD integration. If you use Steal Oldest in this kind of a scene, it is not determined in which order the torch sounds are started (depends on how the scene is loaded, and in what order the instanced objects are in the scene database) so only a few undetermined torches will be audible. As you move through the castle, whenever you enter the audible range of new torches, they will become audible and the ones further back will get virtualized. If you have 80 torches in the scene, and the instance limit is 5 with Virtualize, only the nearest 5 torches will be audible.


Virtualize is useful if you have a larger number of continuously looping point sound sources around a scene, such as torches in a castle. Virtualize seems useful, but not sure how yet. Perhaps background 3D positional music sources (like a jukebox in-game?) The new event only produces sound if the old event stops. None seems to be most useful for focusing on the stopping of an older event and starting of a new event in its place. Perhaps useful for a rotating torso changing direction on a robot? It seems that the new audio event would be doing everything except playing until an old one stops. This is the one that seems best for my use, and I’ve used it and it seems to work very well.

This would seemingly smoothly stop the river sounds you wouldn’t want playing. For example, walking in an area with a long river, you’d only want 5 river sounds playing at a time, not the 100 river sounds that are actually present on the map. Quietest seems to be most useful for using with distance and attenuation. Perhaps for heavy gunfire? Or any super multiple event occurrence where the oldest one doesn’t matter as much as the newest… Oldest would be most useful if playing the newest event instances were the most important.

The max instances property sets a limit on how many instances of this event can play simultaneously.
