Hello FMOD
I’m trying to start events as one shots and also control automation parameters.
From what you wrote on another topic it looks like I should get the event-instance, start and then release the instance.
I have a ball that bounces and I want the impact sound to play each time the ball hits the floor.
I wrote this (C#):
using UnityEngine;
using System.Collections;
using FMOD.Studio;
public class sphereTrigger : MonoBehaviour
{
FMOD.Studio.EventInstance oneShot;
void Start ()
{
oneShot = FMOD_StudioSystem.instance.getEvent("event:/oneShot");
}
void OnCollisionEnter()
{
oneShot.start();
oneShot.release();
print("bounce");
}
}
Console is printing “bounce” each time the ball hits the floor, BUT the sound is only played the first time!
The event contains one event sound with default settings. Everything sounds as it should except the sound is only played once.
What am I missing?
Cheers,
Andreas