Ok so I want it to play a door creak sound when you open the door so I made a script and attached it to the same box collider (trigger is on) that opens the door but my script isn’t working. Heres the script
function OnTriggerEnter(other: Collider){
if (!audio.isPlaying){
audio.Play();
Destroy.audio();
)
}
Thanks!
I’m not sure what you what “isn’t working” about it, like script or just can’t hear the sound, and I don’t use javascript so I can’t adjust your script, but you did have a ‘)’ instead of a ‘}’
and i’m thinking maybe you don’t want to destroy() right after it, i haven’t tried it myself but it’s likely that it’ll destroy the sound quicker than it would play. Just something to maybe look into.
function OnTriggerEnter(other: Collider){
if (!audio.isPlaying){
audio.Play();
Destroy.audio();
}
}