Factorio.com|Forums|Wiki|Mod Portal|API Docs

# Factorio Prototype Docs Version 2.0.77

# CollisionMaskConnector - Prototype Docs

## CollisionMaskConnector :: struct Example code

The base game provides common collision mask functions in a Lua file in the core lualib.

## Properties

- default
- sorted

layers | :: dictionary[CollisionLayerID → `true`] | Every key in the dictionary is the name of one layer the object collides with. [...]
Every key in the dictionary is the name of one layer the object collides with. [...]
not_colliding_with_itself optional | :: boolean | Any two entities that both have this option enabled on their prototype and have an identical collision mask layers list will not collide. [...]
Any two entities that both have this option enabled on their prototype and have an identical collision mask layers list will not collide. [...]
consider_tile_transitions optional | :: boolean | Uses the prototypes position rather than its collision box when doing collision checks with tile prototypes. [...]
Uses the prototypes position rather than its collision box when doing collision checks with tile prototypes. [...]
colliding_with_tiles_only optional | :: boolean | Any prototype with this collision option will only be checked for collision with other prototype's collision masks if they are a tile.
Any prototype with this collision option will only be checked for collision with other prototype's collision masks if they are a tile.

layers | :: dictionary[CollisionLayerID → `true`] | Every key in the dictionary is the name of one layer the object collides with. [...]
Every key in the dictionary is the name of one layer the object collides with. [...]
colliding_with_tiles_only optional | :: boolean | Any prototype with this collision option will only be checked for collision with other prototype's collision masks if they are a tile.
Any prototype with this collision option will only be checked for collision with other prototype's collision masks if they are a tile.
consider_tile_transitions optional | :: boolean | Uses the prototypes position rather than its collision box when doing collision checks with tile prototypes. [...]
Uses the prototypes position rather than its collision box when doing collision checks with tile prototypes. [...]
not_colliding_with_itself optional | :: boolean | Any two entities that both have this option enabled on their prototype and have an identical collision mask layers list will not collide. [...]
Any two entities that both have this option enabled on their prototype and have an identical collision mask layers list will not collide. [...]

## Properties

### layers :: dictionary[CollisionLayerID → `true`]

Every key in the dictionary is the name of one layer the object collides with. The value is meaningless and always `true`. An empty table means that no layers are set.

### not_colliding_with_itself :: boolean optional

Default: `false`

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 :: boolean optional

Default: `false`

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 :: boolean optional

Default: `false`

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 = {layers = {item = true, meltable = true, object = true, player = true, water_tile = true, is_object = true, is_lower_object = true}}

Type used in

- CharacterPrototype::flying_collision_mask
- CreateEntityTriggerEffectItem::tile_collision_mask
- CreateParticleTriggerEffectItem::tile_collision_mask
- DecorativePrototype::collision_mask
- EntityPrototype::collision_mask
- GatePrototype::opened_collision_mask
- InvokeTileEffectTriggerEffectItem::tile_collision_mask
- LandMinePrototype::trigger_collision_mask
- PipeConnectionDefinition::underground_collision_mask
- PlaceAsTile::condition
- ProjectilePrototype::hit_collision_mask
- RailRampPrototype::collision_mask_allow_on_deep_oil_ocean
- RailSignalBasePrototype::elevated_collision_mask
- RailSupportPrototype::collision_mask_allow_on_deep_oil_ocean
- RollingStockPrototype::transition_collision_mask
- RollingStockPrototype::elevated_collision_mask
- SetTileTriggerEffectItem::tile_collision_mask
- TileBuildabilityRule::required_tiles
- TileBuildabilityRule::colliding_tiles
- TilePrototype::collision_mask
- TriggerItem::collision_mask
- UndergroundBeltPrototype::underground_collision_mask
- UtilityConstants::default_collision_masks
- UtilityConstants::show_chunk_components_collision_mask
- UtilityConstants::building_collision_mask
- UtilityConstants::water_collision_mask