Visual scripting

Hello everyone, I recently made a FPS game using Visual scripting in unity, and I want to implement sounds from FMOD. I am having some start up trouble, and wondering if anyone here have some experience getting fmod and bolt to work together nicely?
I have gotten some basic sounds through, like gun shots and footsteps (Oneshots). But I want to implement a loop on my grapplehook statemachine, when I enter the state I want the loop to start, and when I exit i want it to stop.

Hope someone can give me a bit of direction, since there is not a lot of information on it online it seems…
Also if you have any neat tips or tricks for visual scripting and Fmod, please do share. I am keen to learn.

Thanks :)!

We are currently working on improving the documentation on Visual Scripting.
Here is a basic example of how to play a continuous machine gun loop while space is held.

RuntimeManager.CreateInstance is used to create a new sound, then it is started in the enter state and stopped in the exit state. Note the instance needs to be stored in a variable otherwise we will lose our reference to it. Also note the use of RuntimeManager.AttachInstanceToGameObject so that the Event Instance’s transform will follow the player’s position.
State Graph:
Transition to “Firing”:

Transition to “Not Firing”:

Hey Jeff, thank you very much for the thorough explanation! I will try to implement this asap.

1 Like

Hey Jeff, I have another quick question for you. I have implemented steam audio along side Fmod in Unity. But I am getting some errors related to the plugins folders. I suspect it is because my fmod project is located inside my Unity project folder. Is there some way I can safely move my FMOD project out of the unity directory, without breaking it all? Should i just move it out, specify a new project location and then rebuild the banks? What are the best practices for this?

Multiple plugins with the same name ‘phonon_fmod’ (found at ‘Assets/Fmod/FPS_Fmod_Project/Plugins/phonon_fmod.dll’ and ‘Assets/Plugins/FMOD/platforms/win/lib/x86_64/phonon_fmod.dll’). That means one or more plugins are set to be compatible with Editor. Only one plugin at the time can be used by Editor.

Multiple plugins with the same name ‘phonon’ (found at ‘Assets/Fmod/FPS_Fmod_Project/Plugins/phonon.dll’ and ‘Assets/Plugins/SteamAudio/Binaries/Windows/x86_64/phonon.dll’). That means one or more plugins are set to be compatible with Editor. Only one plugin at the time can be used by Editor.


I can see how that would be a problem- you can move your FMOD project outside of the Assets directory, then in the FMOD Unity Settings you can set your path to the new location.

1 Like

Thank you very much!

Hey JefFmod, hope it’s okay I ask another question in this thread so other people can easily find it.
I am looking into using the Snapshot feature with VS and fmod, and I am having a bit of trouble getting it to work. I basically want to try to create a simple slowmotion effect with snapshots, and use a parameter to trigger between normal playbackspeed and slowmotion. Is it possible to get a little example on how to instantiate and change a parameter with VS?
Have a nice day,

Nicolai :)!

A parameter probably isn’t the way to go about playing a snapshot, you should be playing them in the same way as any other event, using Runtime Manager Create Instance and Runtime Manager Start to trigger the snapshot. If you want finer control than just the effect being on or off, you should be using a separate parameter instead of a snapshot.

Alright, thanks I will give that a try :slight_smile: Have a nice day.

1 Like