FAQ
Does 4Players Odin support Apple Silicon?
Yes, it does. But it's important that you run the Unity Editor with Apple Silicon support. At the time of this writing, only version 2021.2 and above are available in an Apple Silicon version. Install the Unity Hub in version 3.x to install the Apple Silicon Unity editor.
Download the Unity Hub here:
Download Unity HubI get an UnityException when leaving PIE or loading a new scene.
Due to the asynchronous nature of the leave room operation, the current recommendation is to avoid invoking this
function within OnDestroy
if the scene is being unloaded. Scene unloading could occur when transitioning between
scenes or shutting down an application.
Instead, the best practice is to call the LeaveRoom OnRoomLeftLoadScene
or Application.Quit
.
room.UpdatePosition
does not work or works incorrectly
room.UpdatePosition
does not work or works incorrectlyPlease make sure to follow these tips:
- The position scale should be set to the same value for all Peers in the ODIN room. The scale value also has to be set
individually for each room that will utilize ODIN's optimization feature. You can set the position scale using
room.SetPositionScale
. - Invoking
room.UpdatePosition
too frequently can lead to operational issues where the optimization of audio streams may not function correctly. Limit the frequency of callingroom.UpdatePosition
to a maximum of 10 times per second. This equates to one update every 100 milliseconds. We recommend using Unity'sCoroutines
to update the position inOdin rooms.
How do I access the live audio feed?
Sometimes, for example if you want to do lip-syncing or if you want to add a graphical equalizer representing the audio
coming from ODIN, you need to get access to the AudioSource
and AudioClip
from ODIN.
This is how you can get access to that information. Somewhere in your code, you attach the ODIN playback component
representing a user to the game object using the function OdinHandler.Instance.AddPlaybackComponent
. This will return
an instance of PlaybackComponent
. Use this component to get access to the AudioClip
:
What is UserData?
Every peer (i.e. player) connected to ODIN has its own user data. Within ODIN, this is just a byte array that you can
use for everything. We provide a class that offers basic user data as a JSON
object. CustomUserDataJsonFormat
You can set the user data before joining a room, or you can also update the user data afterward:
The method CustomUserDataJsonFormat CustomUserDataJsonFormatToUserData
serializes the data stored in the FromUserData
will take the serialized JSON string and
return an instance of
Please check out our guide on user data: