Using FMOD with JavaScript

I am unsure what the procedure is (if there is one/if it’s possible?) if I wanted to insert FMOD events in a script written in JavaScript.

I am comfortable with setting it up to work in scripts written in C# so at the top there is

[FMODUnity.EventRef]
public string eventName = “event:/pathtoevent”;
private FMOD.Studio.EventInstance eventNameRef;
private FMOD.Studio.ParameterInstance parameterNameRef;

and then in Start() you have
eventNameRef = FMODUnity.RuntimeManager.CreateInstance(“eventName”);

and then call these events at the appropriate time.

However how do you do this in JavaScript?

For example if the player controller script is in JS and every time they press jump a PlayOneShot event is triggered. Or if the up key is pressed then a footsteps event is triggered.

Having no luck so far :frowning:

It is very similar to c#, this should start you off.

@FMODUnity.EventRef
public var fmodEvent : String;

A lot of Unity’s tutorials are available in both c# and Javascript: https://unity3d.com/learn/tutorials.