Skip to content

CircleCollider

A circle for collisions, centered on the entity (plus Offset). Its radius grows with the larger of the transform’s X and Y scale, so it stays round. Good for balls, coins, bullets and round enemies.

Circle bodies don’t roll unless their BodyBody.Rotates: one resting on a corner stays balanced there. One that rotates rolls: along the ground, down slopes and over tile floors without slipping, slowed by its Body.RollingResistance until it rests, with its spin carried into its bounces and its sprite turning as it goes.

Works with: Body (to make it move and fall)

Needed by: Body, Bouncer, Breakable, Bumper, Checkpoint, Crumble, DamageOnTouch, Dialogue, Door, Drain, FightingCharacter, FirstPersonMovement, GridMovement, Ladder, Lane, Patrol, Pickup, PlatformerMovement, Plunger, Pushable, Switch, Target, TopDownMovement, WireButton, WireSensor

Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.

  • radius: a number = 0.5. World units before the transform’s scale. 0.5 fits a 1×1 sprite. (Field: a number.)
  • offset: [x, y] = [0,0]. How far the shape’s center is from the entity, before the transform’s scale. (Field: a vector.)
  • isTrigger: true or false = false. Triggers don’t block movement; they report OnTriggerEnter/Exit instead. (Field: on or off.)
  • layer: text = null. A name for what kind of thing this is, e.g. “Player”, “Enemy” or “Bullet”, for Collider.IgnoreLayers and physics queries. Empty is the “Default” layer. (Names a collision layer: this entity’s own, which other fields can name.) (Field: a name.)
  • ignoreLayers: text = null. Layers this collider passes through, e.g. “Bullet, Enemy”: no blocking, no collisions, no triggers. It works both ways, so only one side has to list the other. (Names collision layers: their names, separated by commas.) (Field: a name.)

Not saved with the scene; scripts read them, and entity_get shows them as live while the game plays.

  • turns: true or false. True when the shape turns with its entity: its Body (the entity’s own, or else the nearest one it’s inside) Body.Rotates. Otherwise it stays upright whatever the entity’s rotation, as colliders always have.

Scripts use it as CircleCollider: its methods, events and values that aren’t saved with the scene.