Collision

From Castle Wiki

A Collision is an event that happens when two Actors with bodies run into each other and try to occupy the same space. Depending on the attributes of those actors, a collision may cause them to change velocity or position (i.e. bounce off each other) or fire Rules.

Configuring collisions

To make an actor collide with others, first configure its Collision Shape, which is used to determine how that blueprint's actors collide. To edit the collision shape, open the Art tool for that Blueprint, then select the Collision layer. The collision layer supports circles, rectangles, and triangles.

Note: Text doesn't have art. Text always has a rectangular collision shape determined by the approximate size of the text content.

Solid actors won't overlap with other solid actors. If you want to use physics, such as Bouncing and Friction, or just to make sure actors can't pass through each other, make sure they use the Solid behavior by adding it from the Movement tab of the Inspector.

Text boxes created from a Create text box Response don't have a body and cannot collide.

Running Rules when actors collide

Use the When this collides Trigger to perform actions when an actor collides with other actors. You can use Tags to only run the trigger for specific actors, such as When this collides with tag #wall.

In the Responses underneath a When this collides trigger, you can refer to The colliding actor. For example, you can Tell the colliding actor to do something, or you can read Local Variables that belong to the colliding actor.

You can check if an actor is colliding using the If this is colliding Condition.

If your actor isn't Solid then it may overlap with the colliding actor and fire the collision trigger repeatedly.