Parameter trigger for an event-called by code


(Cesar Tovar) #1

I’m making a test/demo game in Unity to learn Fmod, and in order to make the steps audible in a 3rd person character, I inserted them via events in the animations. For which I made/my friend helped me make/my friend made for me a small code for the character.
Now, I want to have invisible objects work as triggers for the event’s parameters, so that the steps sound in different materials (grass, water, etc).

My problem is that when I create a parameter trigger, it can only find the parameters of events in that scene, so the steps event parameter is nowhere to be found and bound to be at default parameters forever.

Any ideas? For fixing this, or a better way of integrating 3rd person steps?

Thank you!


(Cameron Baron) #2

Apologies if you feel ignored, as mentioned on our licensing page, we try to respond as soon as possible but can have up to a week turnaround at times.

https://www.fmod.com/licensing
Q. What support service is provided with a Free Indie license?
A. Support is provided through FMOD forums and via email with a 1 week response time.

It sounds like you may need to code your own system, as Unity doesn’t reference cross scene objects as you may expect, depending on your needs/limitations.
Using Triggers you can get information about the ‘other’ object, from OnTriggerEnter(), where you could store the information required for each surface to then set the parameter.

Here is a very rough example:

void OnTriggerEnter(Collider other)
{
    switch (other.tag)
    {
        case "grass":
        fmodEvent.setParameter("Surface", 1);
        break;
    }
}

(Cesar Tovar) #3

It was my bad, I missed that part where it says the turnaround is about a week and my previous question was answered super quickly. I’ll definitely try that.
Thanks so much!