NWH Vehicle Physics 2 Documentation
Docs ยป NWH:VehiclePhysics2:StateSettings

State Settings

Example StateSettings.
  • Each vehicle contains multiple VehicleComponents, such as EngineComponent or GroundDetectionComponent. This includes the modules. Each of the VehicleComponents can have a LOD setting and can be Disabled/Enabled.
  • StateSettings is a ScriptableObject containing info about LODs and Enabled/Disabled state of each VehicleComponent. The aim of StateSettings is to prevent having to set the state of each VehicleComponent on each VehicleController individually.
  • The StateSettings can be assigned through the Settings tab of VehicleController.

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 the lodIndex of the component is less or equal to the VehicleController's activeLodIndex.
  • If lodIndex is less or equal to activeLodIndex 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 from StateSettings. This is only done once, on vehicle initialization, so the StateSettings can also be thought of as initial vehicle component state settings.
Previous Next

NWH Vehicle Physics 2 Documentation

Table of Contents

Table of Contents

  • State Settings
      • LODs
      • State Definitions
  • About
  • Setup
  • Input
  • Vehicle Controller
  • Wheel Controller
  • NWH Common Scripts
  • Trailers
  • GUI
  • Multiplayer
  • Render Pipelines
  • Add-ons
  • FAQ
  • Troubleshooting
  • Demos
  • Changelog
  • Upgrade Notes
  • Support