# Assigning FMOD events at runtime

**URL:** https://qa.fmod.com/t/assigning-fmod-events-at-runtime/18511
**Category:** Unity
**Tags:** unity
**Created:** [March 14, 2022, 4:14pm UTC](https://qa.fmod.com/t/assigning-fmod-events-at-runtime/18511 "2022-03-14T16:14:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![celeste.ramirez](https://avatars.discourse-cdn.com/v4/letter/c/ecc23a/32.png) [@celeste.ramirez](https://qa.fmod.com/u/celeste.ramirez)
#### Post date: [March 14, 2022, 4:14pm UTC](https://qa.fmod.com/t/assigning-fmod-events-at-runtime/18511/1 "2022-03-14T16:14:08Z")

</div>

Hello!  
I have a situation where I need to be able to assign different FMOD events to prefabs that are instantiated during runtime. I thought I would be able to use the EventReference.Find() method, but that appears to be for use in the Unity editor only. Is there any way to do this dynamically in a build?

---

<div class="post-metadata">

### Author: ![celeste.ramirez](https://avatars.discourse-cdn.com/v4/letter/c/ecc23a/32.png) [@celeste.ramirez](https://qa.fmod.com/u/celeste.ramirez)
#### Post date: [March 14, 2022, 5:04pm UTC](https://qa.fmod.com/t/assigning-fmod-events-at-runtime/18511/2 "2022-03-14T17:04:56Z")

</div>

Update:

I’ve been playing a bit with the RuntimeManager and I have the PathToEventReference method assigning an event reference based on the event string. However, in the editor, I get an error now that the event is not found, and the GUID it is attempting to reference is “{00000000-0000-0000-0000-000000000000}”. If I click on the wrench inside the editor, it will correct itself, but I need this to find the correct GUID in a build.

---

<div class="post-metadata">

### Author: ![celeste.ramirez](https://avatars.discourse-cdn.com/v4/letter/c/ecc23a/32.png) [@celeste.ramirez](https://qa.fmod.com/u/celeste.ramirez)
#### Post date: [March 15, 2022, 2:20pm UTC](https://qa.fmod.com/t/assigning-fmod-events-at-runtime/18511/3 "2022-03-15T14:20:06Z")

</div>

The response to this topic ended up resolving my issue as well. I’ll be finding a workaround that doesn’t involve assigning events dynamically for now.

> [@Unity GUID does not match path / Help with C#](https://qa.fmod.com/t/unity-guid-does-not-match-path-help-with-c/18491):
>
> Hi all, I’m working on an interactive sound art project using FMOD & Unity. I have a script set up that generates a load of prefab copies named via a text file. At runtime an FMOD event is added to each copy that also pulls its name from the same text file. Unfortunately, when an event is set up in FMOD with the appropriate name the GUID defaults to {00000000-0000-0000-0000-000000000000} and gives an error “GUID does not match path”. If I click the little spanner on the event emitter during runt…

---

<div class="post-metadata">

### Author: ![Merlinmonad](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Merlinmonad](https://qa.fmod.com/u/Merlinmonad)
#### Post date: [March 16, 2022, 11:48pm UTC](https://qa.fmod.com/t/assigning-fmod-events-at-runtime/18511/4 "2022-03-16T23:48:52Z")

</div>

Hey please update this thread if you manage to find a solution for this! Thanks
