Skip to content
On this page

Class: Interactable

WebSG.Interactable

The Interactable class represents an object that can be interacted with, providing information about its current interaction state.

Table of contents

Constructors

Accessors

Constructors

constructor

new Interactable()

Accessors

held

get held(): boolean

Returns the held state of the Interactable object.

Example

ts
node.addInteractable();
console.log(node.interactable.held); // false

Returns

boolean

Defined in

websg.d.ts:196


pressed

get pressed(): boolean

Returns the pressed state of the Interactable object.

Example

ts
node.addInteractable();
console.log(node.interactable.pressed); // false

Returns

boolean

Defined in

websg.d.ts:187


released

get released(): boolean

Returns the released state of the Interactable object.

Example

ts
node.addInteractable();
console.log(node.interactable.released); // false

Returns

boolean

Defined in

websg.d.ts:205