Character
The InworldCharacter Node is responsible for representing an Inworld character within a session.
Configuration
Brain
The brain of your Inworld character from your Inworld Studio workspace.
⚠️ Note: Do not prepend 'characters/'. If the URL of your Inworld Studio character is workspaces/my-godot-workspace-name/characters/my-godot-character, simply enter my-godot-character in this field.
⚠️ Note: Although it is common for the character name and brain to be the same value, the brain name is not the name of your character.
Given Name (Read-Only)
The brain of your Inworld character from your Inworld Studio workspace.
⚠️ Note: This value is read-only, and will be populated when the associated session for the character is established.
Session
The session for the character to receive data from.
Character Usage
Text
func send_text(String text)
Sends a text message of 'text' to the character.
Trigger
func send_trigger(String name, Dictionary params)
Sends a trigger of 'name' with parameters 'params' to the character.
Audio
func start_audio_session()
Starts an audio session with the character.
⚠️ Note: Audio session management is automatically handled by the SDK. Only call this if you know what you are doing!
func stop_audio_session()
Stops an audio session with the character.
⚠️ Note: Audio session management is automatically handled by the SDK. Only call this if you know what you are doing!
func send_audio(PackedByteArray data)
Sends PCM 'data' to the character.
⚠️ Note: Sending audio data is automatically handled by the SDK. Only call this if you know what you are doing!
Interrupt
func interrupt()
Interrupts the character, will signal 'interrupt' and remove any remaining unprocessed MessageTalk.
signal interrupt()
Emitted when the character has been interrupted.
⚠️ Note: Characters will be interrupted automatically when send text, sent a trigger, or STT is recognized.
Character Messages
As data is received from the inworld session, messages will be created and emitted from the character.
Message Talk
signal: message_talk(MessageTalk)
Emitted when the character has a MessageTalk to process.
⚠️ Note: Only one MessageTalk can be processed at a time per character. Call
func finish_current_message_talk()
to release the message.
Data
String text
Text representation of the talk.
PackedByteArray chunk
Raw PCM data representation of the talk.
TypedArray<Viseme> visemes
Lipsync visemes that represent the raw PCM data.
Viseme
StringName code
Code of the viseme.
float time_stamp
Timestamp of the PCM data that the viseme represents.
Message Speech To Text
signal: message_stt(MessageSpeechToText)
Emitted when the character has a MessageSpeechToText to process.
⚠️ Note: As audio data is received, the player speech will continue to update until a final representation has been determined. It is expected to receieve many partial STT messages before completion.
Data
String text
Text representation of the players speech.
bool complete
If the text representation has been finalized.
Message Emotion
signal: message_emotion(MessageEmotion)
Emitted when the character has a MessageEmotion to process.
enum EmotionBehavior {
AFFECTION = 0,
ANGER = 1,
BELLIGERENCE = 2,
CONTEMPT = 3,
CRITICISM = 4,
DEFENSIVENESS = 5,
DISGUST = 6,
DOMINEERING = 7,
HUMOR = 8,
INTEREST = 9,
JOY = 10,
NEUTRAL = 11,
SADNESS = 12,
STONEWALLING = 13,
SURPRISE = 14,
TENSE = 15,
TENSION = 16,
VALIDATION = 17,
WHINING = 18,
};
enum EmotionStrength {
WEAK = 0,
NORMAL = 1,
STRONG = 2,
};
Data
EmotionBehavior behavior
Type of emotion that the character is feeling.
EmotionStrength strength
The strength of the type of emotion that the charcter is feeling.
Message Trigger
signal: message_trigger(MessageTrigger)
Emitted when the character has a MessageTrigger to process.
Data
String name
Name of the trigger.
Dictionary params
Parameters of the trigger.