Hi, Im trying to learn how to script audio clips, now working on rolloffFactors, but it dosent seem to work:
var sound : AudioClip;
var rolloffFactor : float;
function OnTriggerEnter()
{
audio.rolloffFactor == 0.1;
audio.PlayOneShot(sound);
}
Here, a variable sound is supposed to play when the player contacts this object, but the rolloffFactor isent working, and the console says:
Assets/Scripts/PlaySoundOnCollision.js(7,29): BCE0034: Expressions in statements must only be executed for their side-effects. (Filename: Assets/Scripts/PlaySoundOnCollision.js Line: 7).
What do I do?