InworldCharacter
Module: Inworld.AI. Namespace: Inworld. Inherited from MonoBehavior RequireComponent: InworldInteraction.
This script implements the Inworld Character that players can communicate with.
Inspector Variables
Variable | Description |
---|---|
Data | The InworldCharacterData associated with this character. |
CharacterEvents | All the CharacterEvents from this character. |
Verbose Log | Check to enable more detailed logging for this character in the console. |
Properties
Property | Description |
---|---|
Events | Gets the Unity Events of the character. |
Animator | Gets the character's animator. |
IsSpeaking | Gets or sets whether this character is currently speaking. |
CurrRelation | Gets or sets the character's current relationship with players. This will invoke the onRelationUpdated event when set. |
Data | Gets or sets the InworldCharacterData. If set, it will also assign the live session ID to the character's InworldInteraction component. |
Name | Gets the display name of the character. Note that the name may not be unique. |
BrainName | Gets the character's BrainName . Note that the BrainName is actually the character's full name, formatted as workspace/xxx/characters/xxx . It is unique. |
ID | Gets the live session ID of the character. If not registered, it will attempt to fetch one from the InworldController's CharacterHandler. |
Priority | Returns the priority of the character. the character with the highest priority is more likely to respond than characters with lower priority. |
API
Function | Description | Parameters |
---|---|---|
GetLiveSessionID | Register the character in the character list. Get the live session ID for an Inworld character. | |
SendText | Send a message to this character. | text: The message to send. |
SendNarrative | Send a narrative action to this character. | narrative: The narrative text to send. |
SendTrigger | Send a trigger to this character. The trigger is defined in the character's goals section in Inworld Studio. | trigger: The name of the trigger. needCancelResponse: If checked, this sending process will interrupt the character's current speech. parameters: The parameters and values of the trigger. |
EnableGoal | Enable the specified goal for this character. By default, all goals are already enabled. | goalName: The name of the goal to enable. |
DisableGoal | Disable the specified goal for this character. | goalName: The name of the goal to disable. |
CancelResponse | Interrupt the current character's speech, ignoring all incoming messages from the character. |