This document is about: FUSION 2
SWITCH TO

Chat Bubble


Available in the Industries Circle
Circle
Fusion Industries prototyping Addons

This addon provides ready-to-use chat bubbles. People in the same bubble can discuss with other members.

The chat bubbles are build upon the Audioroom and DynamicAudioGroup add-ons: chat bubble are special audio rooms, that separate which dynamic audio group members can start listening to each other when they are close enough.

Fusion Chat Bubble

Static Chat Bubble

A static chat bubble is a room placed at a specific position in the scene.
The access to the chat bubble can be locked manually with a button or automatically when the maximum people parameter is reached.
It can be unlock with the same button or when the last player leaves the chat bubble.
The material of the bubble mesh depends of the lock status.

Setup

The scene must contain:

  • an AudioRoomManager component

The player spawned prefab should contain:

  • a ChatbubbleMember component
  • a DynamicAudioGroupMember component
  • a NetworkLocomotionValidation component, from the Locomotion validation add-on, or any other component triggering ILocomotionObserver.OnDidMove

The chatbubble object itself should contain:

  • a Chatbubble component

ChatBubble

The Chatbubble class manages the chat bubble.
Each bubble can have various shapes (sphere, circle or cube) and has a max capacity parameter. The access into the bubble is not possible if this max capacity is reached.
Chatbubble implements the IAudioRoom interface & registers itself on the AudioRoomManager.
Also, thanks to the IAudioRoomListener interface, the class is informed when an AudioRoomMember enter or leave an AudioRoom, so it can update the chat bubble member list (the local user must have an AudioRoomMember component on its user networked rig, and the required ChatbubbleMember is one of its subclass).

ChatBubbleMember

This class, which inherits from AudioRoomMember, must be added to the player's networked rig.
It includes a ChangeDetector to synchronize a chat bubble, if the audio room entered by this AudioRoomMember is a Chatbubble, to allow late joiners to receive the information without passing through the usual check.
For instance, it is required if from the point of view of the late joiner, entering the bubble is forbidden (if locked is true for instance).
In addition, thanks to the RoomChange methods, when the player enters a chat bubble, its roomID is added to the audio filter (the additionnal criteria required for two closed users can listen to each other, in DynamicAudioGroupMember).

ChatBubbleLocomotionValidator

The ChatBubbleLocomotionValidator component allows to prevent user to move to a chat bubble that is full or locked.

This component implements the ILocomotionValidator interface.
So it can check if the player is allowed to enter into the chat bubble (chat bubble not full).
Please note that the allowedToMoveToChatBubbles setting is used to prevent certain players from entering a chat bubble (e.g. bots).
This class must be added to the player's networked rig.

Dynamic Chat Bubble

A dynamic chat bubble is a specific kind of chat bubble : it is spawned automatically when two players are closed to each other.

Fusion Chat Bubble

Setup

In addition to the regular chat bubble setup, this additional parts are required.

In the scene:

  • a DynamicChatBubbleManager component

On the player spawned prefab:

  • a DynamicChatBubbleSpawner component

On the dynamic chat bubble prefab:

  • a DynamicChatBubble component
  • a NetworkTransform component

DynamicChatBubbleSpawner

DynamicChatBubbleSpawner is in charge to spawn a dynamic chat bubble prefab when two players are closed to each other (this distance is defined by the proximityDistance parameter).
The prefab is spawned by player with the lowest PlayerId.
The dynamic chat bubble is destroyed if the distance between the last two players located in the dynamic chat bubble increase and exceed the limit.
Please note that the chat bubble is not destroyed if the spawning player leaves the chat bubble and several other players are still in the chat bubble.
This class must be added to the player's networked rig.

DynamicChatBubble

DynamicChatBubble inherits from ChatBubble. It is used to register/unregister the dynamic chat bubble on the DynamicChatBubbleManager when the chat bubble is spawned/destroyed.

DynamicChatBubbleManager

DynamicChatBubbleManager manages a pool of DynamicChatBubble.
When a player spawn a DynamicChatBubble, it is added into a dynamicChatBubbles list.
To avoid the overhead of creating and destroying the chat bubble as soon as the distance between players changes, an empty dynamic chat bubble is preserved for the emptyBubbleConservationDuration.

Dependencies

  • AudioRoom addon
  • DynamicAudioGroup addon
  • Touch-Hover addon
  • Locomotion validation addon (optional in some cases)

Demo

A demo scene can be found in the Assets\Photon\FusionAddons\ChatBubble\Demo\Scenes\ folder.

Download

This addon latest version is included into the Industries addon project

Supported topologies

  • shared mode

Changelog

  • Version 2.0.1: Fix to an error triggered upon disconnection
  • Version 2.0.0: First release
Back to top