The ValueField component contains a single field of a specific datatype that is selected when the component is attached.
The ValueField component contains a single field of a specific datatype that is selected when the component is attached.
{{Infobox Component
{{Infobox Component
Line 8:
Line 10:
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Value|Int|
|Value|'''T'''|TypeAdv0=true|
}}
}}
<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
The ValueField component can be used to store a single value on a slot that can be edited from the [[Scene Inspector|inspector]], or with other [[components]] and [[ProtoFlux]]. However, in cases where you want to be able to dynamically reference the value instead of directly referencing it, you may be better off using a [[DynamicValueVariable`1 (Component)|dynamic variable]], and in use cases where you want to easily reference and edit a value within a [[ProtoFlux]] script while still exposing that value to the data model, you may want to use the [[DataModelStore]] node.<!--T:4-->
The ValueField component can be used to store a single value on a slot that can be edited from the [[Scene Inspector|inspector]], or with other [[components]] and [[ProtoFlux]]. However, in cases where you want to be able to dynamically reference the value instead of directly referencing it, you may be better off using a [[DynamicValueVariable`1 (Component)|dynamic variable]], and in use cases where you want to easily reference and edit a value within a [[ProtoFlux]] script while still exposing that value to the data model, you may want to use the [[DataModelStore]] node.
<!--T:4-->
== Examples ==
== Examples ==
[[File:Value Field Demo.png|thumb|A ValueField<floatQ> being used as the input of a ValueCopy<floatQ>]]
[[File:Value Field Demo.png|thumb|A ValueField<floatQ> being used as the input of a ValueCopy<floatQ>]]
A ValueField could be used when another [[Components|component]] requires an input of an external value. <!--T:5-->
A ValueField could be used when another [[Components|component]] requires an input of an external value.
<!--T:5-->
== Related Components ==
== Related Components ==
</translate>
</translate>
Revision as of 19:04, 1 March 2024
The ValueField component contains a single field of a specific datatype that is selected when the component is attached.
Controls whether or not this component is enabled. Some components stop their functionality when this field is disabled, but some don't.
Value
T
Usage
The ValueField component can be used to store a single value on a slot that can be edited from the inspector, or with other components and ProtoFlux. However, in cases where you want to be able to dynamically reference the value instead of directly referencing it, you may be better off using a dynamic variable, and in use cases where you want to easily reference and edit a value within a ProtoFlux script while still exposing that value to the data model, you may want to use the DataModelStore node.
Examples
A ValueField<floatQ> being used as the input of a ValueCopy<floatQ>
A ValueField could be used when another component requires an input of an external value.