World Utilities / UI
Input Fields
Let players edit string and URL values with text input fields.
| Component | Add Component menu / prefab | Source |
|---|---|---|
Value Input FieldVRCTools.World.Values.UI.ValueInputField
|
Values › UI › Value Input Fieldprefab: Input Field.prefab
|
ValueInputField.cs ↗ |
Value URL Input FieldVRCTools.World.Values.UI.ValueUrlInputField
|
Values › UI › Value URL Input Fieldprefab: URL Input Field.prefab
|
ValueUrlInputField.cs ↗ |
Two components bind text inputs to values. Both write to the value as the player types and show the current value when it changes elsewhere.
Input field
Binds a TMP_InputField to a string value.
| Parameter | Default | Description |
|---|---|---|
| Type | LOCAL |
Kind of the bound value. |
| Source/Target | None | The string value. Required. |
URL input field
Binds a VRCUrlInputField to a URL value. This is the only way for
players to enter new URLs at runtime.
| Parameter | Default | Description |
|---|---|---|
| Type | LOCAL |
Kind of the bound value. |
| Source/Target | None | The URL value. Required. |
Both components require their input component on the same game object, with On Value Changed calling
_OnValueChanged. The prefabs come pre-wired.
Every keystroke updates the value. When binding a synchronized value, each change is sent to everybody in the instance. That is fine for short messages, but for longer texts consider binding a local value and copying it into the synchronized one from a “Submit” button in your own script.