Immerse SDK
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

TransformSync

As its name suggests, the TransformSync component is used for synchronising Transforms in an Immerse Session, so that all connected users see objects and other users located in the same place (and orientated in the same direction).

Authority

Transform Syncs work by allowing one client to send the current state of an object, which is then reflected in the views of other users. The user sending these messages is known as the authoritative user.

Taking Authority

It is important to take authority of a Transform Sync when you want the local user to control it (e.g. when they pick up an object). Having the object locally simulated, while the user interacts with it, provides a much better experience as there is no latency.

Authority can be taken by calling TakeAuthority on the Transform Sync component. This method can be also be called using events, making it easy to integrate with existing VR interaction libraries.

Code Reference

Properties

Property Description
Id The unique ID for the TransformSync. This is generated by the Scene Registry in which it is indexed.
Owner Current owner of the TransformSync component.
HasAuthority Returns true if the local user has authority for the TransformSync.
UpdateInterval The interval in which update messages should be sent.
Rigidbody Returns the attached Rigidbody component if one is present.
SyncProperties An enum flag that specifies which properties should be synchronized.
DefaultIsKinematic Default kinematic status for the attached Rigidbody (if present).

Methods

Method Description
TakeAuthority Call this method for the local user to take authority for the TransformSync.
SendUpdate This can be used to send an update immediately. This method takes an optional takeAuthority parameter that, when true, will take authority of the TransformSync if the local user does not have it.
If this method is called and the local user does not have authority and takeAuthority is set to false, no update will be sent.
PropertyIsSynced Returns true if the provided property is to be synced by the TransformSync.