Factorio Prototype DocsVersion 1.1.107

CollisionMask :: array[union] Example code

Every entry in the array is a specification of one layer the object collides with or a special collision option. Supplying an empty table means that no layers and no collision options are set.

The default collision masks of all entity types can be found here. The base game provides common collision mask functions in a Lua file in the core lualib.

Supplying an empty array means that no layers and no collision options are set.

The three options in addition to the standard layers are not collision masks, instead they control other aspects of collision.

Union members

CollisionMaskLayer

A standard collision mask layer.

"not-colliding-with-itself"

Any two entities that both have this option enabled on their prototype and have an identical collision mask layers list will not collide. Other collision mask options are not included in the identical layer list check. This does mean that two different prototypes with the same collision mask layers and this option enabled will not collide.

"consider-tile-transitions"

Uses the prototypes position rather than its collision box when doing collision checks with tile prototypes. Allows the prototype to overlap colliding tiles up until its center point. This is only respected for character movement and cars driven by players.

"colliding-with-tiles-only"

Any prototype with this collision option will only be checked for collision with other prototype's collision masks if they are a tile.

Example

-- Most common collision mask of buildings:
collision_mask = { "item-layer", "object-layer", "player-layer", "water-tile"}

Type used in

Prototypes

Types