I did setup an engine event in fmod with the rpm & load parameter. So, in fmod it works fine. Now, I have implemented fmod into my Unity project and I want to use the awesome engine sound, but it doesn’t works…ok, I can hear the engine sound but without the engine designer power. There is no delay on throttle.
Here is my first code:
public class SoundController : MonoBehaviour {
public float _rpm = 1000;
FMODUnity.StudioEventEmitter emitter;
// Use this for initialization
void Start () {
startSound();
emitter = this.GetComponent<FMODUnity.StudioEventEmitter>();
GetComponent<FMODUnity.StudioParameterTrigger>().TriggerParameters();
}
// Update is called once per frame
void Update () {
updateRPM(10000* PlayerControllerInput.Instance.getThrottle);
}
public void startSound()
{
GetComponent<FMODUnity.StudioEventEmitter>().Play();
}
public void stopSound()
{
GetComponent<FMODUnity.StudioEventEmitter>().Stop();
}
public void updateRPM(float rpm)
{
emitter.SetParameter("RPM", rpm);
}
}
I attached the Studio Event Emitter Script to my GameObject, selected my event, checked the rpm & load parameter and I attached the Studio Parameter Trigger Script…
I didn’t find an answer to my problem. Can someone help me? Or does the power of the engine designer not work in Unity?
I have looked into this video:
Ok, it is an UE4 tutorial. She can select some more Scripts…