Skip to main content

tile_collision

2d · physics · 17 properties · 2D

Collision for a tilemap's own cells: every tile the tileset marks solid, as one shape per behaviour, with the material keys a collider2d takes. A tile that draws its own polygons gets a collider of its own.

In a scene, tile_collision is the node key that applies it. A script reaches the same properties through node.tile_collision.get() and node.tile_collision.set(table).

Properties

propertytypedefaultdescription
active_collisionsflags["dynamic_dynamic","dynamic_kinematic","dynamic_static"]Which pairs of body kinds this collider is tested against; a sensor watching kinematic platforms needs more than the default One of dynamic_dynamic, dynamic_kinematic, dynamic_static, kinematic_kinematic, kinematic_static, static_static.
contact_force_thresholdfloat0How hard a contact must be before on_contact_force is called At least 0.
contact_skinfloat0A margin the solver treats as already touching; stops thin shapes tunnelling and jittering At least 0.
densityfloat1Mass per volume, so the shape's size sets its mass At least 0.001.
enabledbooltrueCollide at all; a disabled collider keeps its shape and costs nothing
eventsflags[]What this collider reports to its node's script: on_collision_start and on_collision_stop, or on_contact_force One of collision, contact_force.
frictionfloat0.5Surface friction; 0 is ice At least 0.
friction_combineenumaverageHow this surface's friction combines with the other one's One of average, min, multiply, max, clamped_sum, geometric_mean.
layersflags["0"]The layers this collider is on One of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31.
maskflags[]The layers it collides with; empty means every layer One of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31.
massfloat0Mass in kilograms, overriding what density works out to; 0 keeps the density At least 0.
one_wayboolfalseA platform bodies pass through from below and land on from above
restitutionfloat0Bounciness: 0 is a dead stop, 1 a full rebound Range 0–1.
restitution_combineenumaverageHow this surface's bounciness combines with the other one's One of average, min, multiply, max, clamped_sum, geometric_mean.
sensorboolfalseDetects overlaps without colliding: bodies pass through and are reported
solver_layersflags["0"]Layers for the solver alone: a pair can be detected but not resolved One of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31.
solver_maskflags[]Which solver layers this one pushes against; empty means all of them One of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31.