This feature is supported as of BeamNG.tech and .drive version 0.22 to latest.
The Triggers section is used to position clickable boxes on vehicles which emulate buttons, switches, door handles and other hand-operated components.
Since update 0.40, “mesh triggers” are supported. They are triggers with an additional “mesh” property, which makes it so when hovering over the trigger, instead of its ‘hitbox’ visually showing, a mesh (flexbody or prop) on a vehicle is highlighter, which makes for a more visually pleasing experience.
This section cannot exist on its own. It needs an Event section, which determines the code to be executed, and TriggerEventLinks which links the two.
events defines the actual things to execute (like input_actions.json, but inside a part)triggerEventLinks links together triggers and eventsFor the newer triggers2 workflow, action code is usually defined in *.interaction.json files instead. See Interaction Maps
and Triggers2
.
0.40.2.0 contains
3 entries in
1 sections distributed over
21543 parts in
5434 jbeam files.example value for Box type:
{"x":0.25, "y":0.05, "z":0.08}
example value for Sphere type:
0.25
Uses the intrinsic Euler -X -Z -Y rotation system, the center of rotation being the corner of the box that defines position.
example value:
{"x":0, "y":0, "z":0}
Uses the intrinsic Euler -X -Z -Y rotation system, the center of rotation being the corner of the box that defines position.
example value:
{"x":0.2, "y":0.26, "z":-0.05}
Overwrites baseTranslation.
Relative to the Jbeam/world coordinates. {“x”:0, “y”:0, “z”:0} will put the prop in the position 0, 0, 0 according to the coordinates of the modelling software.
Commonly used values are:
At least one of them must be defined for the event to work.
{
"triggers":[
["id", "label", "idRef:", "idX:", "idY:","type", "size", "baseRotation", "rotation","translation", "baseTranslation"],
["cargodoorR", "", "cd4r","cd4rr","cd3r", "box",{"x":0.25, "y":0.05, "z":0.08},{"x":0, "y":0, "z":0},{"x":0, "y":0, "z":0},{"x":0, "y":0, "z":0},{"x":0.2, "y":0.26, "z":-0.05}],
],
"triggerEventLinks":[
["triggerId:triggers", "action", "targetEventId:events"],
["cargodoorR", "action0", "toggle_doorR"]
],
"events":[
["id", "title", "desc"],
["toggle_doorR", "ui.inputActions.van.toggle_doorR.title", "ui.inputActions.van.toggle_doorR.description", {"onUp":"electrics.values.doorR = 1-(electrics.values.doorR or 0)", "order": 2}]
],
}
Was this article helpful?