Why am I not receiving contact_point_response when colliding with trigger?

There is something I don’t understand.

I have two objects A and B both with a collision object; type A is Kinematic and type B is static. When A and B collide I get the message “contact_point_response” in a script attached to A. Everything fine.

If I change the type of the collision object of B to trigger (and I do NOT change the type of the collision object of A) then I don’t get anymore the “contact_point_response” in A.

But according to the docs, the message “contact_point_response” should be sent since A is kinematic.

What am I doint wrong?

Many, many thanks!

Ciao!

1 Like

I’m not sure you are doing anything wrong to be honest. Trigger objects are treated differently and probably not included in the normal flow of resolving collisions. I do not know the details but my guess is that contact_point_response will only happen when colliding with dynamic, kinematic and static objects, not triggers.

Thanks @britzl .

The docs here Collision messages in Defold states that contact_point_response is sent when “one of the colliding objects is dynamic or kinematic”…

So, it should or the docs are incorrect / old…

2 Likes

I recently had all kinds of odd behavior from triggers. So much so I had to stop using them.

Fwiw.

I believe the docs are simply wrong in this case. I just tested it a bit, and “contact_point_response” messages are never sent for an interaction between a trigger and something else. Triggers are only for “on/off” testing if an object is overlapping the trigger or not.

You will also notice that with physics debug drawing enabled, there are no little cyan arrows showing contact points with triggers—there are no contact points.

A couple other points:

  • All messages get sent to both objects. So for example if a kinematic object enters a trigger, both the kinematic and trigger objects will get the “trigger_response” message. Likewise, static objects will get messages when any other object interacts with them.
  • “trigger_response” messages are only sent for “enter” and “exit” events, not every frame during a collision.
2 Likes

Hey @ross.grams thank you so much for confirming this.

I understand that it makes sense to NOT have the contact_point_response given that the triggers are only for testing overlappings. I was just claiming that probably the docs are wrong about this.

Ciao, Rocco.

1 Like

Thanks. I’ve updated the documentation to reflect this.

2 Likes