Difference between revisions of "ValueCopy (Component)"

From Neos Wiki
Jump to navigation Jump to search
(add small note about unnetworked valuecopy)
 
(3 intermediate revisions by one other user not shown)
Line 13: Line 13:
 
|Source|IField`1|TypeString0=IField<float>| The source to copy the value from.
 
|Source|IField`1|TypeString0=IField<float>| The source to copy the value from.
 
|Target|IField`1|TypeString1=IField<float>| The target to copy the value to.
 
|Target|IField`1|TypeString1=IField<float>| The target to copy the value to.
|WriteBack|Bool|
+
|WriteBack|Bool| Allow Target to write back to Source.
 
}}
 
}}
  
 
<!--T:3-->
 
<!--T:3-->
 
== Usage ==
 
== Usage ==
Drives the target's value with the source's value.
+
Drives the target's value with the source's value. When using WriteBack, changes made to the Target are local while editing it. When the user is done setting it, it writes via a network sync to change the Source value. If the Source and Target are the same, the value will be completely local, and no network sync happens when changing the value. When using the ValueCopy to make fields local like this, joining users will have the host's value by default.
  
 
<!--T:4-->
 
<!--T:4-->
Line 27: Line 27:
 
[[File:ValueCopyExample2.png | 512px | ValueCopy Example]]
 
[[File:ValueCopyExample2.png | 512px | ValueCopy Example]]
 
A ValueField<int>'s Value is being driven to be 7 from another ValueField<int>'s Value. The one in pink is the one being driven.
 
A ValueField<int>'s Value is being driven to be 7 from another ValueField<int>'s Value. The one in pink is the one being driven.
 +
 +
[[File:ValueCopyExample3.png | 512px | ValueCopy Example]]
 +
The Target field is being edited to 4, to write back to the Source field.
  
 
<!--T:5-->
 
<!--T:5-->

Latest revision as of 09:28, 14 February 2023


This article or section is a Stub. You can help the Neos Wiki by expanding it.


Value Copy`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
Source IField<float> The source to copy the value from.
Target IField<float> The target to copy the value to.
WriteBack Bool Allow Target to write back to Source.

Usage

Drives the target's value with the source's value. When using WriteBack, changes made to the Target are local while editing it. When the user is done setting it, it writes via a network sync to change the Source value. If the Source and Target are the same, the value will be completely local, and no network sync happens when changing the value. When using the ValueCopy to make fields local like this, joining users will have the host's value by default.

Examples

ValueCopy Example A ValueField<bool>'s Value is being self driven with a WriteBack - making the Value local, and still changeable. Changes to this value will be local.

ValueCopy Example A ValueField<int>'s Value is being driven to be 7 from another ValueField<int>'s Value. The one in pink is the one being driven.

ValueCopy Example The Target field is being edited to 4, to write back to the Source field.

Related Components