State Settings
- Each vehicle contains multiple
VehicleComponents
, such asEngineComponent
orGroundDetectionComponent
. This includes the modules. Each of theVehicleComponents
can have a LOD setting and can be Disabled/Enabled. StateSettings
is aScriptableObject
containing info about LODs and Enabled/Disabled state of eachVehicleComponent
. The aim ofStateSettings
is to prevent having to set the state of eachVehicleComponent
on eachVehicleController
individually.- The
StateSettings
can be assigned through the Settings tab ofVehicleController
.
For more info about VehicleComponents and their states and LODs check VehicleComponent page.
LODs
- LODs can be set through the StateSettings ScriptableObject.
- If the component has a LOD set (
lodIndex >= 0
) a piece of code is run each frame to check if thelodIndex
of the component is less or equal to theVehicleController
'sactiveLodIndex
.
- If
lodIndex
is less or equal toactiveLodIndex
the component will be enabled, otherwise disabled.
- When LOD system is active it overrides the
ENABLED
button for that component and enables/disables the component based on LOD settings and the distance from the camera.
State Definitions
- Each
VehicleComponent
loads state fromStateSettings
. This is only done once, on vehicle initialization, so theStateSettings
can also be thought of as initial vehicle component state settings.