VehicleComponent
is a building block of NWH Vehicle Physics 2.
VehicleController
is a collection of VehicleComponent
s, which includes VehicleModule
s, Effects
and SoundComponent
s - both of which inherit from VehicleComponent
.
For class reference click here.
Each VehicleComponent
can:
VehicleComponent
that is enabled is updated.isOn
can be used instead.lodIndex
value is lower than vehicleController.activeLodIndex
it will be enabled, otherwise it will be disabled. lodIndex
to a value less than 0 to ignore LODs.
VehicleComponent
s that have isOn
set to false
are disabled and can not be enabled by LODs.
Turning components off should be used for components that will never be used.
Each VehicleComponent
has a state bar which is visible in play mode:
This is where the state of the
VehicleComponent
can be checked and changed. Note that changing the state through state bar only affects runtime values and will revert after exiting play mode. The state bar is intended for previewing the current state and testing different values during run-time. For persistent state check StateSettings.
Enabled
button is greyed out as the LODs determine if the component will be enabled or disabled.VehicleComponent
on each VehicleController
, a ScriptableObject
StateSettings
was introduced.StateSettings
for each vehicle can be assigned under VehicleController ⇒ Settings tab. StateSettings
on State Settings page.
To change VehicleComponent
state through scripting following can be done:
myVehicleComponent.IsEnabled= myBoolValue; myVehicleComponent.IsOn = myBoolValue; myVehicleComponent.LodIndex = myIntValue;