(SOLVED) How do you create a message when two objects touch

Hi everyone. I’m really new to Defold and have a basic question. When my two game objects touch each other I want a message broadcast so I can add functionality. I’m trying to recreate Breakout from Atari and need to make the ball bounce when it touches the paddle. How can I broadcast a message when they touch.

Thank you very much and I’m very excited to join the community!

Did you give your objects collision-object components? If so they’ll each receive the “collision_response” or “trigger_response” message when they touch. See the docs: http://www.defold.com/ref/physics/ and http://www.defold.com/manuals/physics/

You’ll probably want to use triggers or kinematic bodies, not “dynamic” / rigidbodies.

3 Likes

Thank you! Guess I got some reading to do!

2 Likes

Worked perfectly!

2 Likes

Nice! I don’t believe I’ve heard of anyone trying to create a breakout game using Defold. It’s a perfect fit for Defold and I wish you best of luck! Let us know how it goes!

Will do! Its my first project.

1 Like