NWH Vehicle Physics 2
Search Results for

    Show / Hide Table of Contents

    Input States

    InputStates inspector.

    VehicleInputStates is a struct that holds all vehicle input values and button states, normalized to standard ranges.

    Key Features

    • Normalized Ranges: Analog inputs (throttle, brakes, steering, clutch, handbrake) are normalized to 0-1 or -1 to 1
    • State Copying: Entire input state can be copied between vehicles (e.g., trailer synchronization)
    • Raw Values: Each analog input has both processed and raw versions for debugging
    • Input Swapping: When swapInputInReverse is enabled in VehicleInputHandler, throttle and brake axes swap in reverse gear for more intuitive control

    Input Fields

    Analog Inputs

    • steering [-1, 1]: -1 = full left, 1 = full right
    • throttle [0, 1]: Accelerator pedal position
    • brakes [0, 1]: Brake pedal position
    • clutch [0, 1]: 0 = engaged, 1 = disengaged (manual transmission)
    • handbrake [0, 1]: Parking brake / drift brake

    Swapped Inputs

    • inputSwappedThrottle: Contains throttle in forward gears, brake in reverse
    • inputSwappedBrakes: Contains brake in forward gears, throttle in reverse

    Button States

    • shiftUp / shiftDown: Sequential shifting
    • shiftInto: Direct gear selection (-1 = reverse, 0 = neutral, 1+ = forward gears, -999 = no shift)
    • engineStartStop: Toggle engine on/off
    • leftBlinker / rightBlinker / hazardLights: Turn signals
    • lowBeamLights / highBeamLights / extraLights: Lighting controls
    • horn: Horn button (held down state)
    • trailerAttachDetach: Attach/detach trailer (requires TrailerHitchModule)
    • cruiseControl: Toggle cruise control (requires CruiseControlModule)
    • boost: Boost activation (requires NOSModule or similar)
    • flipOver: Right overturned vehicle (requires FlipOverModule)

    Note: Also check Input Setup page.

    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics