Triggers (detecting collisions) and physics settings

Posted on

Collision trigger

Thanks to Andrzej Kilijański and our physics engine Kraft, we add two features to our physics support:

  1. We now support triggers. A trigger is a rigid body through which other objects “pass through”, but it still reports a collision. This is useful to observe when something passes through something else.

    E.g. coins in “Mario” games could be implemented as triggers — when player collides with them, they are consumed, and player does not “bounce off” them like from a wall.

    An example of using trigger is available in examples/physics/physics_2d_collisions, the green rectangle acts as a trigger there.

  2. You can adjust physics properties by adjusting SceneManager.PhysicsProperties.Xxx. See the TPhysicsProperties docs.

Comment on this post ➤