Gunshot as camera goes through a wall?

I’m trying to have an sfx played as the camera goes through a wall, but the sound repeats every frame if the camera sits in the intersection, instead of one single gunshot and if the user goes back, one gunshot again.

Is there any other way of doing this?

Something like this ?


Exactly like that. Super thanks :smiley:

Do you know by any chance if I can load more gunshot files, and play them randomly so that is not the same gunshot?

yes, just create a few of them, put them in a array and use a random value for the array index :slight_smile:

I don’t think I understand what you mean, never used an array and can’t find any documentation

Is it SmartArray?

Something like this (just a normal javascript array)

1 Like

I’ve noticed that if I rotate the wall, the intersection point messes up.

Is it the bounding box? How can I update it?