Similar to Activatables, when interacted with, Adjustables emit events allowing you invoke specific behaviors. Rather than simply emitting an “on” or an “off”, Adjustables emit a float value

<aside> ℹ️ Adjustables share some functionality with the other grabbable types, see the Grabbables page for more information

</aside>

<aside> ℹ️ Adjustables can be a little fiddley, you may find it easier to copy the examples in the SampleScene and adapt them, rather than starting from scratch

</aside>

Adjustables take the form of sliders, wheels, and levers. Once grabbed the user, the adjustable can be translated or rotated (depending on its MovementType) to change the value it emits

MovementType

Your Adjustable must have a correctly configured “MovementType”. To determine what MovementType is needed, click on the root Adjustable GameObject and check its local vectors. In the example shown to the right, we want the wheel to rotate around the blue axis (the Y axis), so we choose “YRotate” in the Adjustable’s MovementType field

Untitled

Receiving output value

In order to handle the float value output by the Adjustable, we must write a script taking float and string parameters, and link it to the Adjustable’s OnValueAdjusted event in the inspector

//Link this function to the OnValueAdjusted event in the Adjustable's inspector
public void OnValueAdjusted(float value, string playerID)
{
		Debug.Log($"Player with ID {playerID} changed the value to {value}!");
}

Setting output value through code

//Expose reference to GameObject in inspector
[SerializeField] private GameObject gameObjectWithVirseComponent; 

//Reference to the ViRSE component's interface, in this case, IAdjustable
private IAdjustable virseComponent => gameObjectWithVirseComponent.GetComponent<IAdjustable>();

//An example of programmatically invoking behavior on the adjustable
private void ResetAdjustable()
{
	virseComponent.SetValue(0); //Reset the adjustable to its original value
}

Adjustable Properties

<aside> 🤓 IsProgrammatic You may only wish to utilize Adjustables only for their automatic syncing functionality, rather than providing something for the user to interact with. When IsProgrammatic is set to true, the Adjustable no longer requires anything “physical” in the scene, and it can instead be adjusted through code, whereupon the float value will be synced to other clients in the instance as usual

</aside>