Trigger Solution for a PlaySnd

Started by gabe555, June 16, 2016, 08:30:28 PM

Previous topic - Next topic

gabe555

Hey people, this is so basic, but it's been 4 years since I coded something, and I just started all over again 2 weeks ago... Anyway, I'm a little bit rusty with it...

I got this helper, its a ball comming from the air, and I want to play this sound once the ball touches the floor.

[State 4805, PlaySnd]
type = PlaySnd
triggerall = pos y > -55 ; This is the possiton of my helper "on the floor" maybe I'll adjust this value later
trigger1 = (?)
value = 4803
volume = 255

additional data:
- sound 4851,12 sec
- the ball animation loops
- The ball doesn't destroy itself when touching the floor, just want to play the sound of it hitting the floor.

How would you make it work?

altoiddealer

Well, in the helper state you can just use

[State 4805, PlaySnd]
type = PlaySnd
trigger1 = Pos Y >= 0
value = 4851,1
volume = 255
persistent = 0

You just want the sound to play one time, correct?


gabe555

Quote from: altoiddealer on June 16, 2016, 09:11:01 PM
Well, in the helper state you can just use

[State 4805, PlaySnd]
type = PlaySnd
trigger1 = Pos Y >= 0
value = 4851,1
volume = 255
persistent = 0

You just want the sound to play one time, correct?


Thanks man! worked this way: trigger1 = Pos Y >= -50