How to add proper sound to sliding door.

So I got cute auto opening sliding door reacting to proximity box trigger. Visually works great, even reacts when I approach it when it already is closing and it switches back to reopening. But I am unable to add sound to it in a proper way.

I do not want sound that just plays when entering and leaving box trigger. It can play multiple sounds at once constantly triggering when moving on the edge of trigger. What I need is a nice once played sound every time the door either starts to open or close. Cannot seem to do it.

Second problem is when I tried to split the closing door into seperate timeline rather than reverse input. Also am unable to figure out how to to it. Door starts jumping around. I am guessing something to do with changed relative position. Help would be appreciated.

The easiest way is to get rid of the delay, and make a custom event to play the right sound effect.

You can always ask it to play ‘open’ or ‘close’, but it keeps track of which it’s playing, and will only play the ‘other’ sound.

Tell me if you need more info, and I’ll come back later…

I don’t see how that would solve my problem. Anyway I kinda found solutions to both problems I think. The only way to prevent sounds from constantly triggering is to “do once” for entire chain. The problem with Timeline and Move_Component_To is that their complete/finished state keeps triggering sounds over and over when you get in and out of trigger area. So yeah, do once is the only solution I found. Downside is that you can while quickly moving in and out to catch door closing that will stay closed until you reenter the trigger area, but I think that is possible without “do once” anyway, some in between ticks low precision or something. I am not a programmer so no idea there.

Sorry, yes I didn’t explain it well. You have two main options

  1. DoOnce - which you’ve found… Then it just open, or it shuts, and does the whole thing. You can also do tests to see how far away the player is, and close the door if they’re not near ( and you missed the end overlap ).

  2. You have the nodes connected directly, like you did in the first place. But then you have to handle stopping the open sound to play the back end of the close sound, if the player starts to overlap, and then changes their mind. And the other way around.

Option 2 can look quite slick, but you have to do quite a lot of fiddling to get the sounds right.

1 Like

Alright, thanks.
Distance as secondary trigger sounds interesting. Gotta remember that. All this is new to me and quite painful ( 3rd headache today because of that nonsense). There should be make game button.

1 Like

There must be a million ways of doing doors. All pros and cons, and personal preference… :slight_smile: