Skip to main content

PlayerController

Module: Inworld.AI. Namespace: Inworld.Sample.

This singleton gameObject is the demo example for how to interact with Inworld. For developers please feel free to create your own.

Variables

VariableDescription
UIKeyThe KeyCode for opening the global chat panel. By default it's the ~ key.
OptionKeyThe KeyCode for opening the config panel. By default it's the ESC key.
SkipKeyThe KeyCode for enabling skip utterances globally. By default it's not set.
ContinueKeyThe KeyCode to manually move to the next sentence in a conversation. By default it's not set.
PushToTalkDetermines whether push to talk is allowed.
PushToTalkKeyThe hot key used to enable push-to-talk. By default is C.
InputFieldThe input field for players to input texts.
DropDownThe drop down button for selecting InworldCharacters in the global chat panel.
SendButtonThe button to send texts.
RecordButtonThe button hold to push-to-talk, and release to send the audio.

Events

EventsDescription
onPlayerSpeaksTriggers when the text was sent by player, or when the speech-to-text was received.

API

FunctionDescriptionParameters
SendTextSend target message in the input field.
SelectCharacterByDropDownSelect the character by the default dropdown component.nIndex: the index of the character selecting drop down.
OpenFeedbackInterface for opening the feedback dialog. It'll be implemented in several Inworld child classes.interactionID: the InteractionID of the target Interaction.
correlationID: the CorrelationID of the target Interaction.

PlayerController2D

Module: Inworld.AI. Namespace: Inworld.Sample. Inherited from PlayerController.

This is the demo player controller used in 2D sample scene.

PlayerController3D

Module: Inworld.AI. Namespace: Inworld.Sample. Inherited from PlayerController.

This is the demo player controller used in 3D sample scene.

VariableDescription
ChatCanvasThe global chat panel gameObject.
StatusCanvasThe status canvas gameObject.
FeedbackCanvasThe feedback canvas gameObject.
OptionCanvasThe config canvas gameObject.
BubblePanelThe panel to render chatbubbles or other bubble layouts.