Scripting API

Scripting API

BoxCollider2D

Struct in Abyss.Physics2D, from Abyss.Physics2D.

A box an entity meets things with: on its Rigidbody2D, or the nearest one above it, or ground where there is none. The other colliders are on a body the same way. Its size and place in the entity's own units, scaled with it.

public struct BoxCollider2D

Fields

Size

public Vector2 Size

How wide and high it is.

Offset

public Vector2 Offset

Where its middle is, from the entity's.

EdgeRadius

public float EdgeRadius

How round its corners are: the box grows by it all round.

IsTrigger

public bool IsTrigger

Whether it meets nothing and is told of what enters it.

Material

public AssetRef<PhysicsMaterial2D> Material

What it is made of; none for Physics 2D's settings' default.

Density

public float Density

How heavy it is for its size, in kilograms a square meter: what its body's mass is worked out from where its Rigidbody 2D says Use Auto Mass.