# Visual scripting

**URL:** <https://qa.fmod.com/t/visual-scripting/18354>\
**Category:** Unity\
**Created:** [February 13, 2022, 10:23pm UTC](https://qa.fmod.com/t/visual-scripting/18354 "2022-02-13T22:23:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![NRSsoundDesign](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@NRSsoundDesign](https://qa.fmod.com/u/NRSsoundDesign)\
**Post date:** [February 13, 2022, 10:23pm UTC](https://qa.fmod.com/t/visual-scripting/18354/1 "2022-02-13T22:23:15Z")

</div>

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 :)!

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [February 17, 2022, 4:00am UTC](https://qa.fmod.com/t/visual-scripting/18354/2 "2022-02-17T04:00:56Z")

</div>

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.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/9/9a270a153e428b73195629b519dc13552f6637a4.png)  
`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:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/2/274e82649a15e460b34f89d35e96f6d9c81b3c96.png)  
Transition to “Firing”:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/b/b05fdda7a204477d7f7d1e01e957dd65388c6682.png)  
Transition to “Not Firing”:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/0/0dee00530b07735b261c75e5af4452ea1dd9d8e1.png)

---

<div class="post-metadata">

**Author:** ![NRSsoundDesign](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@NRSsoundDesign](https://qa.fmod.com/u/NRSsoundDesign)\
**Post date:** [February 17, 2022, 10:31am UTC](https://qa.fmod.com/t/visual-scripting/18354/3 "2022-02-17T10:31:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NRSsoundDesign](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@NRSsoundDesign](https://qa.fmod.com/u/NRSsoundDesign)\
**Post date:** [February 20, 2022, 8:10pm UTC](https://qa.fmod.com/t/visual-scripting/18354/4 "2022-02-20T20:10:37Z")

</div>

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.

Thanks!  
Nicolai.

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [February 20, 2022, 9:51pm UTC](https://qa.fmod.com/t/visual-scripting/18354/5 "2022-02-20T21:51:35Z")

</div>

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](https://fmod.com/resources/documentation-unity?version=2.02&page=settings.html#bank-import) you can set your path to the new location.

---

<div class="post-metadata">

**Author:** ![NRSsoundDesign](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@NRSsoundDesign](https://qa.fmod.com/u/NRSsoundDesign)\
**Post date:** [February 20, 2022, 9:59pm UTC](https://qa.fmod.com/t/visual-scripting/18354/6 "2022-02-20T21:59:22Z")

</div>

Thank you very much!

---

<div class="post-metadata">

**Author:** ![NRSsoundDesign](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@NRSsoundDesign](https://qa.fmod.com/u/NRSsoundDesign)\
**Post date:** [March 13, 2022, 11:43am UTC](https://qa.fmod.com/t/visual-scripting/18354/7 "2022-03-13T11:43:51Z")

</div>

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 :)!

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [March 16, 2022, 4:05am UTC](https://qa.fmod.com/t/visual-scripting/18354/8 "2022-03-16T04:05:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![NRSsoundDesign](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@NRSsoundDesign](https://qa.fmod.com/u/NRSsoundDesign)\
**Post date:** [March 16, 2022, 12:14pm UTC](https://qa.fmod.com/t/visual-scripting/18354/9 "2022-03-16T12:14:41Z")

</div>

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