null reference exception with FMOD in unity integration.


#1

I’ve seen a few people have this problem on the forum that have fixed it with insuring the Main Camera has the FMOD listener component attached to it however I am still receiving these errors with it attached. I have also made sure FMOD, unity and the integration package are all up to date and started the process repeatedly again from scratch. I still receive these error codes:

NullReferenceException: Object reference not set to an instance of an object
FMOD_StudioSystem.PlayOneShot (System.String path, Vector3 position, Single volume) (at Assets/Plugins/FMOD/FMOD_StudioSystem.cs:225)
FMOD_StudioSystem.PlayOneShot (System.String path, Vector3 position) (at Assets/Plugins/FMOD/FMOD_StudioSystem.cs:217)
PlayerController.OnTriggerEnter (UnityEngine.Collider other) (at Assets/Scripts/PlayerController.cs:56)

Any help would be much appreciated :slight_smile:


#2

This is happening because the event path you’re passing into PlayOneShot() doesn’t correspond to any event.

In the next release we’ll improve the logging and stop the crashing.


#3

Is there nothing I can do in the mean time then?


#4

Yes, don’t call PlayOneShot() with event names that don’t exist. You can check if GetEvent() returns non-null to see if the event path exists.


#5

Thanks very much for the info, i have worked round it now :slight_smile:


#6

Hi Matt, would you mind mentioning what you did to fix the error? I’m having the exact same one. It sounds like I just have the even name incorrect, but I’ve checked it over and over without finding anything wrong. Cheers


#7

Hi Andy,

If you grab version 1.05.06 of the integration the issue reported by Matt is fixed. If you’re still having problems then it’s a separate issue and please start a new topic.


#8

Thanks Nicholas, I will do that!