Collisions with 2 things

Is there a way of making a game object collide with 2 different game objects, and react in a different way with each object? And how would you implement it?

Yes.

I recommend reading this many times, as well as the rest of the manual. groups and masks.

Useful but I still don’t understand how to have two objects to act in a different way when colliding with a player. :disappointed_relieved:

Differentiate based on the other_group in the collision messages received:

2 Likes

I am quite new, so I what do I have to do instead of hash as when I type in the object name I get an error!

A hash is a faster reference to an item. I suggest you do the five tutorials you can open when you run Defold. They are fun to do.

1 Like

I figured it out after using the tutorial with the stars. Thanks for your help. :smiley:

2 Likes