Immerse

Messaging

Once connected to a session, the Immerse SDK allows you to send and receive to/from other users in the same session and by making use of some of the message behaviours available. It can also be used to preserve a session's state.

Defining a New Message Type

Custom message types are defined in the Custom Messages section of the Immerse SDK settings found within the Unity Project Settings panel.

There are a number of fields required in order to create a new custom message. Each are detailed below.

Description

Name

A descriptive name for the message. This is for your own reference.

Message Type

A unique message ID. This is used to identify your message, so it goes to the right place. Note that 0 - 999 is a reserved range used by the platform messages, therefore your message type should be >= 1000

Profile

Who can send this message? The default value is Participant, this allows all users to be able to send it. The Space Owner option will restrict the message so only the owner of the space may send it.
If a non-space owner tries to send a restricted message, it will be filtered by the server and fail silently.

Is Persisted

When set to true, a message sent will be remembered by the server and sent to any users joining/rejoining the session.
It is possible to save multiple messages of the same type by using different message IDs when sending a message. You can then overwrite those saved messages by sending another message with the same message ID.

Broadcast to Self

If enabled, messages of this type when sent will be sent back to the sender as well as to other users. Enabling this behaviour is typically best practice as it helps ensure that clients remain sychronized.

🚧

Make sure to update your project after add/editing messages. Or your messages will not work as expected.

Updated 27 days ago

Messaging


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.