# Advanced Version ‐ Knobs - Outerra/anteworld GitHub Wiki
Advanced Version - Knobs
Knobs are interactive objects that allow you to interact with vehicle components such as the engine start/stop button, handbrake lever and turn or normal lights while in Interactive Mode. To add knobs, you have to do following steps.
First, you need to add knobs to your model in your modeling program. You can find more information about this on our Interactive page. If you bind the act_name of your knobs to existing config files—matching them exactly (for example, "vehicle/lights/turn" for turn signals)—you can trigger them using shortcut keys, see your interactive object move, and use the object simultaneously.
Once you’ve properly added the knobs to your model, you can import it into OWS using the Asset Importer (press F5 to open it). Select the File section and open your model file. Verify that all model components are correct and if they are, go to the Import section and click Import All. After completing this, you can access your knobs in first-person camera mode (press C to switch camera), then enter Interactive Mode by pressing Tab-a hand will appear, allowing you to interact with the objects.
You can also view and adjust your knob properties after selecting your vehicle in the Outerra Engine’s Scene Editor (press F9 to open it). Then, go to Plugins > Knobs Editor. You’ll see a list of your knobs and by clicking on a knob, you can view its properties like this:
You can temporarily change the knob values under Current State, but this will not affect the package configuration.
Now you have interactive knobs such as levers and buttons but they need to be registered to be functional. Some knobs, like a gear lever, can be directly registered with existing vehicle functions (for example, the transmission system) and will work automatically.
However, if you want a knob to perform a custom action—such as opening the bonnet or trunk when pressed—you first need to define the bones of those parts (e.g., the bonnet and trunk) in the bones list within the global scope and map each one to its corresponding bone ID in the init_chassis function. This step is not required for the knob itself but because those parts are physical bones in the model.
Once this setup is complete, you can register the knob with the corresponding bone and specify custom parameters or behaviors in your handler function. Below is an example of how to register handlers to define specific rotation behavior for these bones.
Adding the bonnet and trunk bones to the bones list:
let bones = {
steer_wheel: -1,
speed_gauge: -1,
accel_pedal: -1,
brake_pedal: -1,
driver_door: -1,
bonnet: -1,
trunk: -1,
};
Mapping each bones to the corresponding bone ID:
function init_chassis() {
// Other codes here
bones.steer_wheel = this.get_joint_id('steering_wheel');
bones.speed_gauge = this.get_joint_id('dial_speed');
bones.accel_pedal = this.get_joint_id('pedal_accelerator');
bones.brake_pedal = this.get_joint_id('pedal_brake');
bones.driver_door = this.get_joint_id('door_l0');
bones.bonnet = this.get_joint_id('bonnet');
bones.trunk = this.get_joint_id('trunk');
// Other codes here
}
Now we need to register all the knobs we want to make functional. In this example, we register a handler for the transmission lever knob without any custom behavior and handlers for the bonnet and trunk levers to define their specific rotation behaviors.
Example of registering knobs:
// Registering a new handler that links the "knob_action_transmission_lever" event to the reverse_action function
this.register_handler("knob_action_transmission_lever", reverse_action);
// Defining two new handlers with parameters as we want, to open the bonnet and trunk
this.register_handler("knob_action_bonnet_lever", function(v) {
this.geom.rotate_joint_orig(bones.bonnet, v * 0.7, { x: 1 });
});
// The first parameter is the bone, the second is the opening angle, and the last defines the stop position
this.register_handler("knob_action_trunk_lever", function(v) {
this.geom.rotate_joint_orig(bones.trunk, v * 0.7, { x: -1 });
});
This completes the setup process, making your knobs fully functional and ready to interact with the vehicle’s systems. You can follow this same approach to register any other knobs in your vehicle, linking them to custom functions or defining custom behaviors to make your setup fully interactive.