I started using FMOD and Mathf.Lerp to create a sound engine for my game in Unity.
I'm using the examples in documents/Fmod VEHICLE and using custom physics for my car. When I run the game the audio doesn't work, and problem with fmod studio event emitter and listener in gameobject.
Actually im using and following this https://www.fmod.com/docs/2.02/unity/integration-tutorial.html and I am new to FMOD and Unity, 50-50 you can say!
Can you please help me to run this and make it work with Max rpm and min and speed of car
This is the code I tried which has some issue:
using UnityEngine;
public class ArcadeEngineAudio : MonoBehaviour
{
PG.CarController rezx;
void Awake()
{
rezx = GetComponentInParent<PG.CarController>();
}
void Update()
{
float effectiveRPM = Mathf.Lerp(rezx.MinRPM, rezx.MaxRPM, rezx.CurrentSpeed);
var emitter = GetComponent<FMODUnity.StudioEventEmitter>();
emitter.SetParameter("RPM", effectiveRPM);
}
}
Thanks in advance.
I tried to use engine rpm, min rpm, and max rpm which doesn't work, even the current speed.