Skip to main content

Session

The InworldSession Node is responsible for starting and stopping sessions with Inworld.

Configuration

Player (Optional)

If the player property is set before start() is called, the session will register the player properties with the session. This will enable characters from this session to reference the player by their given name.

Project Name (Optional)

A unique identifier for your project. Though not required, this will help the inworld support team to identify your sessions.

Workspace Name

The name of your Inworld Studio workspace.

⚠️ Note: Do not prepend 'workspaces/'. For example if the URL of your Inworld studio workspace is workspaces/my-godot-workspace-name, simply enter my-godot-workspace-name in this field.

Scene Type

The type of scene for the session to use.

Scene: A normal inworld scene. You can configure these scenes from the 'Scenes' tab in your inworld studio workspace.

Single-Character: An automatically generated scene that contains a single character. No scene from the inworld studio workspace is required.

Scene Name

The name of a scene in your Inworld Studio workspace.

For scene type, use the name of the desired scene from the 'Scenes' tab in your inworld studio workspace.

⚠️ Note: Do not prepend 'scenes/'. For example if the URL of your Inworld studio scene is workspaces/my-godot-workspace-name/scenes/my-godot-scene, simply enter my-godot-scene in this field.

For single-character type, use the name of the desired character from the 'Characters' tab in your Inworld Studio workspace.

⚠️ Note: Do not prepend 'characters/'. For example 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.

Auth

The Base64 Authorization Key generated from Inworld Studio.

You can generate a key from the 'Integrations' tab in your inworld studio workspace. Under the 'API Keys' section, click '+Generate new key', then click 'Copy Base64'.

Session Usage

Managing Sessions

func start() -> void Start the inworld session.

func stop() -> void Stop the inworld session.

Connection State

enum ConnectionState {
IDLE = 0,
CONNECTING = 1,
CONNECTED = 2,
FAILED = 3,
PAUSED = 4,
DISCONNECTED = 5,
RECONNECTING = 6,
};

func get_connection_state() -> ConnectionState Get the current connection state.

signal: connection_state_changed(ConnectionState) Emitted when the connection state changes.

func get_connected() -> bool Get if the current connection state is CONNECTED.

signal: connected(bool) Emitted when the connection state changes between CONNECTED and anything other than CONNECTED.

func get_established() -> bool Get if the session has established session info.

signal: established(bool) Emitted when the session establishes or is torn down.