TheAutopilot (talk | contribs) m fixed fire on local link |
add on every frame info |
||
Line 14: | Line 14: | ||
{{Template:Basic Fire On Information|Fire On Change|change|the OnlyForUser ([[Type:User|User]]) provided|[[ProtoFlux:Fire On Local Change|Fire On Local Change]]}} | {{Template:Basic Fire On Information|Fire On Change|change|the OnlyForUser ([[Type:User|User]]) provided|[[ProtoFlux:Fire On Local Change|Fire On Local Change]]}} | ||
This node '''does not''' runs the calculation on every frame<ref>Nuki's message on Discord (requires account) https://discord.com/channels/1040316820650991766/1154514007479287942/1251599026479169627</ref><ref>Frooxiu's messge on Dicord (requires account) https://discord.com/channels/1040316820650991766/1154514007479287942/1251600403926351933</ref>. | |||
== Inputs == | == Inputs == |
Revision as of 18:28, 15 June 2024
Fire On Change Nodes will only fire if the OnlyForUser (User) provided has seen the value on their local machine change.
When this node triggers from the OnlyForUser (User) provided it can be used to execute code that requires the impulse be from a specific user. This is useful for things like:
- changing world properties
- physics
- cloud variables
- other Local User sensitive nodes.
This node does not runs the calculation on every frame[1][2].
Inputs
OnlyForUser (User)
Is the User "watching" for changes, if the Value (Generic) is localized and only changes for the OnlyForUser User, then it will send out a impulse for every change vs someone else who wouldn't see those changes.
For best practice, this should never be left null
or evaluated differently based on the user (e.g. via LocalUser). If this input is null
and the node is parented under a user, then the impulse will be fired for said user. If this input is null
and not parented under a user, or if this input evaluates differently for different users, then the impulse will tend to be fired for the first user that sees the change in value. This is usually the one who caused the change in the first place. This could cause inconsistent behavior unless carefully managed. If the desired behavior is for an impulse to fire by every user that detects a change for them locally, then use the local version of this node, which is linked at the bottom of the page.
Value (Generic)
The value or reference that OnlyForUser (User) should watch for changes on their client.
Outputs
OnChanged (impulse)
Will fire a single impulse from the OnlyForUser (User) input every time the value provided changes.
Examples
-
Fire On Change being used to tell when someone is on the ground according to the host user of a session.
See Also
- ↑ Nuki's message on Discord (requires account) https://discord.com/channels/1040316820650991766/1154514007479287942/1251599026479169627
- ↑ Frooxiu's messge on Dicord (requires account) https://discord.com/channels/1040316820650991766/1154514007479287942/1251600403926351933