Relevant VE2 documentation is linked at the bottom of this page
In the previous lesson, you practised linking your scripts with activatables to trigger certain behaviours, as well as programmatically determine their current state. This is a common pattern in VE2 (and Unity in general), and in this lesson you’ll do the same with adjustables!
Like with activatables, there are two methods for doing this, you can either expose a public method in your script and wire it up the event in the adjustable’s inspector (good for triggering behaviour at the moment the event is emitted), or you can expose a public InterfaceReference in your script, and assign it to the adjustable so you can access its methods and properties via the interface (good for when we need to do things outside the moment the event is emitted). We’ll cover both here
When working with adjustables, you need to declare functions that take a float parameter to capture the value that the adjustable is currently set to.

Similar to activatables, drag and drop the gameobject containing your script into the OnValueAdjusted event on the adjustable inspector. Then, select your function to tell VE2 to invoke that function when the event occurs, passing the float value.

Our Adjustable, configured to invoke our public function
<aside> ⚠️
As touched on in lesson one, it is crucial to remember to wire the event up to instance of your method shown under “Dynamic float” rather than “Static parameters”, so that the adjustables value is actually sent to the method via its parameter. If your method doesn’t appear under “Dynamic float”, it is possible it doesn’t take the correct parameter, or it isn’t public.

</aside>
To talk to adjustables programmatically, we must use the same syntax we covered in the previous lesson. Expose an InterfaceReference field in the inspector, with a type argument matching the VE2 component you want to talk to, in this case, IV_SlidingAdjustable

<aside> 📝 Exercise One - Adjust the scale of the target
<aside> 📝 Exercise Two - Adjust the speed of the target
<aside> 🤓
If you want to go even further, there are also adjustables that can adjust on multiple axis! V_SlidingAdjustable2D and V_RotatingAdjustable2D. These can be used to create two-dimensional sliders and joysticks. You can find prefabbed examples by right-clicking in the hierarchy, selecting VE2 → Interactables → Slider2D and Joystick2D
</aside>
<aside> ⚠️ This section is all extension material. You will need to have completed extension exercise 1B in Lesson Two to do this. if you’d rather skip over this extension material, feel free to jump ahead to UIs
</aside>