Scripting API

Scripting API

Trigger2D

Record struct in Abyss.Physics2D, from Abyss.Physics2D.

A body that went into or came out of a trigger: Physics2D.TriggersEntered and Physics2D.TriggersExited.

public readonly record struct Trigger2D

Constructors

Trigger2D

public Trigger2D(ulong Trigger, ulong Other, ulong OtherCollider)

A body that went into or came out of a trigger: Physics2D.TriggersEntered and Physics2D.TriggersExited.

Parameters

  • Trigger: The entity of the trigger: a collider with Is Trigger ticked, on a body or under one.
  • Other: The body that went in or came out: an entity with a Rigidbody 2D, or ground.
  • OtherCollider: The entity of its collider that went in first, or came out last: Other itself, or one under it.

Properties

Trigger

public ulong Trigger { get; init; }

The entity of the trigger: a collider with Is Trigger ticked, on a body or under one.

Other

public ulong Other { get; init; }

The body that went in or came out: an entity with a Rigidbody 2D, or ground.

OtherCollider

public ulong OtherCollider { get; init; }

The entity of its collider that went in first, or came out last: Other itself, or one under it.

Methods

Involves

public bool Involves(ulong entity)

Whether entity is the trigger, or the body or the collider that went in.

Parameters

  • entity