I’m working with unity, fmod 1.09.06 and the oculus spatializer and I have issues using AttachInstanceToGameObject.
I have isolate the problem:
- i create the istance of the object.
- i call the AttachInstanceToGameObject.
- if i move the obj the sound stays where it was created.
I do this simple thing with the following lines:
eventInst = FMODUnity.RuntimeManager.CreateInstance (asset); FMODUnity.RuntimeManager.AttachInstanceToGameObject (eventInst, this.transform,this.GetComponent<Rigidbody> ());
This doesn’t move the sound while i move the object, and I also get this warning:
FMOD Studio: Instance of Event event:/04_OBJECTS/OBJ_Diorama/OBJ_Diorama_Gear_Blocked has not had EventInstance.set3DAttributes() called on it yet! UnityEngine.Debug:LogWarningFormat(String, Object) FMODUnity.RuntimeManager:Update() (at Assets/Plugins/FMOD/RuntimeManager.cs:412)
What am I doing wrong?
I’ve also tried using the function
eventInst.set3DAttributes (FMODUnity.RuntimeUtils.To3DAttributes (this.transform));
in the update and everything works fine, but it’s not a clean solution in my project.
Thank you for your help,