Skip to main content

Helper Scripts

Helper scripts are not SyncEntities, meaning they do not sync data but run locally like any normal script. They are designed to work with SyncEntities and help with common synchronization needs.

DisplayStorageProperty

The DisplayStorageProperty helper displays a storage property value found on the specified SyncEntity. This can be useful either as a UI helper or a debugging tool.

  • The Property Key should match the one being used by the storage property.
  • Text is the Text component that will display the value text.
  • If Use Format is enabled, a formatting string can be specified instead of displaying the value directly.
  • Alt Text will be displayed if the value is undefined, such as before the session has connected or the storage property has not been defined yet.

SetEnabledIfOwner

The SetEnabledIfOwner helper enables and disables scene objects based on the target SyncEntity or instantiated object's ownership state.

Entity Target can either be a Network Root, for use inside of prefabs link, or a SyncEntity. If Network Root is selected, this script will automatically find its network root upon instantiation.

Whenever the Entity Target becomes owned by the current user (or starts that way), each object in Owner Objects will be enabled, and each object in Non Owner Objects will be disabled.

Whenever the Entity Target becomes not owned by the current user (or starts that way), each object in Owner Objects will be disabled, and each object in Non Owner Objects will be enabled.

Was this page helpful?
Yes
No