Hi,
Trying to do a slowmo effect that also lowers the pitch of all sounds in the SFX Group.
I have a local parameter called Bullet Time Pitch that, when its 1, has the pitch modified by 0 using an automation curve, and -24st at 0.
in my code I’m doing this:
void Awake()
{
BulletTime = FMODUnity.RuntimeManager.CreateInstance("snapshot:/Bullet Time");
}
void StartSlowMo(float TargetTimeScale)
{
BulletTime.setParameterByName("Bullet Time Pitch", targetTimeScale);
}
void StopSlowMo()
{
BulletTime.setParameterByName("Bullet Time Pitch", 1f);
}
but it doesn’t work. if I debug.Log the value of “Bullet Time Pitch” using getParameterByName, it always returns as 0 even when it should be my given value.
if I add a global parameter instead, and do
FMODUnity.RuntimeManager.StudioSystem.setParameterByName("Bullet Time Pitch", 1f);
it does actually set the value of the parameter to my given float, as I can tell through a debug.log print + getParameterByName. however, in game, nothing happens.
Additionally the documentation says it’s supposed to return an error if it can’t find a parameter with the given name, but even if I type in some random nonsense, I don’t get any errors; it just always returns 0 if I try to getParameterByName, which means that I’m not really sure how to debug this.
Any help would be appreciated, thanks.