Trigger an action on physics

Hi there,
I tried to add some physics to this example but I need to trigger an action when the ball is overcoming the line that is at 120 pixel from the top.

Basically when the ball is touching or overcoming the line I need to play a sound.

Any suggestion? Thanks (22.1 KB)

You want to apply some momentum using code through the Physics engine rather than set the position. Another common way for less code savvy Hype users is to use another element (set to use physics) as a racket.

You can find some good links from the forum here:

Like the great mini templates from @Photics

1 Like

Thank you so much. Here the jump example with sound. I have to work to simplify the code. As usual it's a beginning. (40.0 KB)

1 Like