Skip to content

Interactor

This Interactor struct contains a set of functions for dealing with interactors.

Properties

YaEntity entity

Interactor's entity.

ScanMode scanMode

The scanMode interactor's using.

E.g. in function InteractableObject.OnInteractorEnter(callback<Interactor>), if this interactor scans an interactableObject with ScanMode.PhysicsClient, the parameter interactor in callback<Interactor> 's scanMode will be ScanMode.PhysicsClient

Functions

void OnObjectEnter(function callback<InteractableObject>)

CLIENT ONLY 
Provides a callback that will be invoked when an interactable object enters the interactive range.

void OnObjectLeave(function callback<InteractableObject>)

CLIENT ONLY 
Provides a callback that will be invoked when an interactable object leaves the interactive range.

void OnInteractionStart(function callback<InteractableObject, number>)

Provides a callback that will be invoked when the interactor starts interacting with an interactable object in interactive range.

void OnInteractionStop(function callback<InteractableObject, number>)

Provides a callback that will be invoked when the interactor stops interacting with the interactable object.

boolean InteractWithObject(YaEntity targetEntity, ScanMode scanMode, [number interactionType])

CLIENT ONLY BETA 
Interacts with an interactable object in the specified scan mode with an interaction type, when the interactor is within the interactive range. The interaction types denote different interactions which you can customize for yourself, ranging from 1-20000.

boolean StopInteractWithObject(YaEntity targetEntity, ScanMode scanMode, [number interactionType])

BETA 
Stops the specified interactable object from being interacted with.

boolean SetInteractable(YaEntity interactableObjectEntity, [ScanMode scanMode])

SERVER ONLY BETA 
Sets the object to interactable in your custom scan mode when the object is in the interactive range. In the custom scan mode, you can implement your own mechanism for scanning interactable objects.

boolean SetUninteractable(YaEntity interactableObjectEntity, [ScanMode scanMode])

SERVER ONLY BETA 
Sets the object to uninteractable in your custom scan mode when the object is in the interactive range. In the custom scan mode, you can implement your own mechanism for scanning interactable objects.