Error CS0234: The type or namespace name 'RunTimeManager' does not exist in the namespace 'FMODUnity'

Hello,

I’m following this tutorial: https://www.youtube.com/watch?v=nnT2-ldNEHs&list=PLp4vT3ssm5SUgZiG7dPaIfan1c0khdTKS&index=2

Around minute 10 we call a OneShot event using this line of code: FMODUnity.RunTimeManager.PlaySoundOneShot(path, GetComponent().position)

In the video everything works fine after that but I’m getting this: Assets/_CompletedAssets/Scripts/Enemy/EnemyMovement.cs(25,13): error CS0234: The type or namespace name ‘RunTimeManager’ does not exist in the namespace ‘FMODUnity’ (are you missing an assembly reference?)

Any ideas will be appreciated!

Edit: by the way, I should mention that I’m using Unity 2018.4.17f for this.

Hi there!

You have some typos - lowercase “t” in RuntimeManager. Also there’s no “Sound” in the PlayOneShot method

Should look like FMODUnity.RuntimeManager.PlayOneShot(path, transform.position).

Are you using an IDE with Intellisense and code completion to write your code? I’d recommend Visual Studio, or Visual Studio Code with Unity extensions. They can help in catching these kinds of errors.

1 Like

Thanks so much for helping a newby out! I’m learning so much, it’s fun. I just fixed it like you mentioned but I still had a problem… took me 5 mins to realize every statement needs a ;

It’s easier now that I understand that the red underline in Visual Studio is pointing at the problem… Completely missed that one.

By the way, is there something like a database with common FMOD C# lines to double check in case I run into other issues?

Thanks again, the sound is playing now :)!!!

1 Like

no problem!

I’d recommend bookmarking the scripting examples page, for whichever version of FMOD you’re using: https://www.fmod.com/resources/documentation-unity?version=2.0&page=examples-basic.html

Really helped me when I was learning.

When you’re ready to go a bit further, I’ve highly recommend Alessandro Fama’s tutorials for intermediate topics and technical sound design: https://alessandrofama.com/tutorials/fmod-unity/

Thanks a lot for those resources!