Make a sound on random
http_gamesalad
Member Posts: 1,340
I have this attribute called active .. its set up like this every random (2,3) seconds change attribute game.active to random(1,6)
How would I make this actor play a sound evertime game.active changes?
Comments
The Timer behavior can't be used to randomize the Every option. You'll need to use something like this: http://forums.gamesalad.com/discussion/comment/464547/#Comment_464547.
Generally speaking, to have a sound play, you would just have a rule for each sound (If attribute game.active=1 then play sound [sound1]; if attribute game.active=2 then play sound [sound2]; etc.).
If you want to avoid the problem where repeated choices (2,2,2,3) do not trigger a rule, see this: http://forums.gamesalad.com/discussion/comment/513319/#Comment_513319.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang I never thought about doing game.active=1 then play sound [sound1]; if attribute game.active=2 then play sound [sound2]; etc.). face palm thanks bro
worked perfectly