Component:ReferenceUserOverride

From Resonite Wiki
Revision as of 15:44, 1 May 2024 by 989onan (talk | contribs) (formatting)

This is a component that allows you to locally change a reference on a value. Changing the value locally for yourself or others so that an item or world element is different depending on who's viewing it.

Component image 
Reference User Override`1 component as seen in the Scene Inspector


Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
Target direct RefDrive`1<T> The value to drive locally for every user
Default T The content of this value will be inside of Target for every user locally unless otherwise specified by an Override inside of the _overrides bag.
CreateOverrideOnWrite Bool When flux or any other means tries to set the value of target from someone's machine, create an Override for them in _overrides bag.
PersistentOverrides Bool whether to save the overrides or not when the component is part of a hierarchy being saved. This is useful to turn on when an item should have overrides
_overrides direct SyncBag`1<Override<T>> A bag of Overrides that are read to make local changes to the value referenced by Target

Override

Fields
Name Type Description
User UserRef The User that should see Value's content inside of Target locally instead of Default's content
Value T The value that User should see target driven to locally.


UserRef

Fields
Name Type Description
User User The user that matches the _machineId and _userId.
_machineId String The machine id last known for a User. Is used to try to identify the user and fill User user ref field the next time they're in a world with this component.
_userId String The user's account ID last known for a User. Is used to try to identify the user and fill User user ref field the next time they're in a world with this component.


Usage

Examples

Related Components