InworldCharacter
This script implements the Inworld Character that players can communicate with.
Inspector Variables
Variable | Description |
---|---|
Data | The InworldCharacterData for this character |
Audio Interaction | The character's AudioInteraction |
Current Avatar | The character's Animator |
Sight Angle | The character's field of view, displayed in Gizmos |
Sight Distance | The character's sight distance, displayed in Gizmos |
Sight Refresh Rate | How often the characters are calculating priority |
Properties
Property | Type | Description |
---|---|---|
Data | InworldCharacterData | Returns InworldCharacterData |
ID | string | Returns the ID for the character. The ID or CharacterID field will be generated only after LoadingScene() is successful |
CharacterName | string | The display name for the character. Note that CharacterName may not be unique |
BrainName | string | The BrainName for the character. Note that BrainName is actually the character's full name, formatted like workspace/xxx/characters/xxx . It is unique |
IsValid | bool | Returns True if the character has InworldCharacterData |
HasRegisteredLiveSession | bool | Checks if this InworldCharacter has been registered in the live session |
Priority | float | Returns the priority of the character. The higher the priority is, the more likely the character is to respond to the player |
CurrentAudioRemainingTime | float | Returns the remaining time for the character's audioClip . This data will be modified by AudioInteraction |
Event | InteractionEvent | Returns the Unity Event of Interaction |
Audio | AudioInteraction | Gets or sets the character's AudioInteraction. |
CurrentAvatar | gameObject | Gets or sets the model it is bound to |
Emotion | string | Get the current emotion (last emotion received from server) of the character. |
Gesture | string | Get the current gesture (last gesture received from server) of the character. |
API
Function | Return Type | Description | Parameters |
---|---|---|---|
LoadCharacter | void | Lets an InworldCharacter bind data. This model can be of any kind (e.g., even a cube). If the input model is null , then it will download a model and attach to it whenever it has a valuable modelUri . Otherwise, it will attach to the default avatar. | incomingData: The InworldCharacterData to bind to model: The model to bind to |
ResetCharacter | void | Resets the history items for a character and performs audio cache clean-up | N/A |
SendText | void | Sends text to the character via a InworldPacket | text: the text to send |
SendTrigger | void | Send target character's trigger via InworldPacket. | triggerName: The trigger to send. Both formats are acceptable. You could send either whole string from CharacterData.trigger, or the trigger's shortName. |
SendEventToAgent | void | Sends general events to the character | packet: The InworldPacket to send |