Scripting API

Scripting API

Physics2DSettings

Struct in Abyss.Physics2D, from Abyss.Physics2D.

Physics 2D's settings, a page of Project Settings: the pull on every body, how many times Box2D works each step out, what queries find, and which layers' bodies meet which. Kept in settings/physics-2d.json, which a built game's pack carries; a game reads them with Res<Physics2DSettings>, and may change them for the run.

public struct Physics2DSettings

Fields

Gravity

public Vector2 Gravity

The pull on every body, in meters a second squared, a world unit being a meter: down, as the Earth's.

SubSteps

public int SubSteps

How many times Box2D works each step out, Box2D's sub-steps: more is steadier and slower.

DefaultMaterial

public AssetRef<PhysicsMaterial2D> DefaultMaterial

What a collider is made of where it names no material of its own; none for Box2D's own.

QueriesHitTriggers

public bool QueriesHitTriggers

Whether a ray, a swept shape or an overlap asked of Physics2D finds triggers as it finds solid colliders; off, it passes through them.

QueriesStartInColliders

public bool QueriesStartInColliders

Whether a ray or a swept shape that starts inside a collider hits it there, at no distance; off, it passes over it to what is beyond, so a ray down from a body's middle finds what is under it.

Collisions

public LayerMatrix Collisions

Which layers' bodies meet which; those that do not pass through each other.