Skip to main content
Supported on
Snapchat

Sync Materials

SyncMaterials keeps named properties on a material in sync across the session. Use it for a team color, a highlight that everyone should see, or any material value that is part of shared game state.

Component Inputs

NameTypeDescription
Network Id TypeObject Id or CustomHow the network id is generated. Defaults to Object Id.
Custom Network IdstringShown when Network Id Type is Custom. Defaults to enter_unique_id.
Auto ClonebooleanClones the material so this object's synced values do not affect every other object sharing it. Defaults to true.
Main MaterialMaterialThe material to sync. Required.
Property Namesstring[]The material property names to keep in sync.

If Main Material is left empty the component logs You need to set mainMaterial! and does nothing else.

Auto Clone

Materials in Lens Studio are shared assets. Without cloning, syncing a property writes to the material itself, so every object using it changes. Auto Clone is on by default for that reason. Turn it off only when you deliberately want the change to apply everywhere the material is used.

Was this page helpful?
Yes
No