@ 3com
I don't need the button to be animated, to make it less complex for my self. The result i want is to push the button to activate the sound, and the sound should then fade when i move away from the sound source. Players will not be able to revisit later and the generator will remain active.
Im making an asylum where the power is out, the player is supposed to start the generator in the generator room before entering the the main building. After entering the building, the player will not be able to get outside again (jumps to next level).
it's the logic when i code i find difficult. What to put, when to put, what order, what goes first, what goes next. when i read a script i know 80% what it say's and what it does. But when i start a blank LUA my self it's like my brain is exploding.
i tried to make it without script using trigger zones, spawn entity with sound, and entity with sound relative to player distance. But no luck.
so then i found 2 script's that i thought could work and played around with it, also with no luck. one script like yours and the switchmain, i tried to put them together
The way i tink is: When E is pressed -- then activate entity with your script -- goes on continuously.
hope this makes some kind of sense