In an emmitter on ball game object, I have a music hit triggering on ball collision (“bumps”). I want it to fade this emitter out once I am close to a certain game oblect.

I have an event parameter (toEndbumps) controlled by a variable that is the distance between the ball and the certain game object (vimeovector).

In the ball user control script I do this in the FixedUpdate()

//calculate distance between ball and vimeo screen
float vimeovector = Vector3.Distance(rb.transform.position,(GameObject.FindGameObjectWithTag(“Vimeo Screen”)).transform.position);

        toEndbumps.setValue (vimeovector);

It refuses to change. In the Event Editor in FMOD, the event works fine; I dial down the parameter and it fades the sound to a curve starting at distance 10. My guess is that every collision resets the initial value of that parameter? The vimeovector float works for all other event parameters where I am also controlling volume in Fixedupdate.

  • You must to post comments
Best Answer

If you are using PlayOneShot() you will not be able to change parameter values on the event. PlayOneShot starts the event and immediately releases it, what this does is tells the System it can clean this event up when it stops playing and then wipes the handle.
This means any event you call release on will play out (if it is playing), but any handle/reference you had to it will become invalid.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.