I’m trying to crate a lift. and I have done it. but I want to add sounds for that. so I added isActivteLift Boolean variable to the scene.
I want to know, How to get only one object for condition? there are many “lift” objects. I want to play lift sound, If at least one of any lift object is active.
Simply in here, I want to check at least one of any “lift” object is true. (any condition for that?)
You’ve to check every lift object and then decide if you’re playing a sound or not. So, create a boolean type scene variable to hold the result, for example “playSound”.
Use a For Each Object loop to check all the lift objects.
Set playSound to false before the loop.
If the For Each Object finds an active lift, set playSound to true.
After the loop is finished, play the sound if playSound is true.
If Erdo answer is not what you are looking for can you explain
are you lifting like a box and you want sound of the moment when picking it up?
or sound when walking with lifted object?
Or is it something else?
you have levers that are lifted and you want to play sound only when one of them is lifted? Like alarm? and if next one is lifted you don’t want 2 alarm sounds to be played?
Also
does sound should play all the time or you want it to play only when lifting object happens?