n-collider

altspace/components. n-collider

Abstract base class for n-sphere-collider, n-box-collider, n-capsule-collider, and n-mesh-collider. You cannot use this class directly, but instead you should add one of those components to your objects.

Extends

Members

center :vec3

The offset of the collider in local space.

Default Value:
  • [0, 0, 0]

isTrigger :boolean

If true, this collider will not block other objects, but instead fire a triggerenter event when an object comes into contact with it, and a triggerexit when it leaves contact.

Default Value:
  • false

type :string

The type of collider, one of: object | environment | hologram. Object colliders collide with other objects, the environment, and the cursor. Environment colliders collide with everything objects do, but you can also teleport onto them. Hologram colliders only collide with other holograms and the cursor.

Default Value:
  • "hologram"

Events

triggerenter

Fired when an object enters a trigger volume, e.g. isTrigger: true

triggerexit

Fired when an object leaves a trigger volume, e.g. isTrigger: true