NWH Vehicle Physics 2
Search Results for

    Show / Hide Table of Contents

    Class ArcadeModule

    Arcade driving assists applied as extra forces and torques on the vehicle Rigidbody, on top of the tire simulation. Steer assist adds yaw torque independent of tire grip, drift assist holds a target drift angle, and spin-out prevention damps excess yaw rate. Each is tuned or switched off independently.

    Inheritance
    object
    VehicleComponent
    ArcadeModule
    Inherited Members
    VehicleComponent.state
    VehicleComponent.vehicleController
    VehicleComponent.IsActive
    VehicleComponent.VC_Initialize(VehicleController)
    VehicleComponent.VC_Initialize()
    VehicleComponent.VC_SetDefaults()
    VehicleComponent.VC_LoadStateFromStateSettings()
    VehicleComponent.VC_Update(float)
    VehicleComponent.VC_Enable(bool)
    VehicleComponent.VC_Disable(bool)
    VehicleComponent.VC_DrawGizmos()
    VehicleComponent.VC_Validate(VehicleController)
    VehicleComponent.UpdateLOD()
    VehicleComponent.ToggleState()
    Namespace: NWH.VehiclePhysics2.Modules.ArcadeModule
    Assembly: NWH.VehiclePhysics2.dll
    Syntax
    [Serializable]
    public class ArcadeModule : VehicleComponent

    Fields

    artificialSteerStrength

    Multiplier on the yaw torque added straight to the Rigidbody, so the vehicle turns regardless of tire grip. 0 is off, 1 is an arcade-sim balance, 2+ is full arcade. Torque scales with vehicle mass and speed, and only applies while fully grounded.

    Declaration
    [Tooltip("Torque that will be applied to the Rigidbody to try and reach the steering angle,\r\nirrelevant of the tire slip. Only active when vehicle is fully grounded.")]
    public float artificialSteerStrength
    Field Value
    Type Description
    float

    counterSteerReward

    Assist reduction when counter-steering correctly. 1 = full player control.

    Declaration
    [Tooltip("Assist reduction when counter-steering. 1 = full player control.")]
    public float counterSteerReward
    Field Value
    Type Description
    float

    counterSteerStability

    Bonus stability when counter-steering correctly.

    Declaration
    [Tooltip("Stability bonus when counter-steering.")]
    public float counterSteerStability
    Field Value
    Type Description
    float

    driftAngle

    Current drift angle in degrees. Positive = right, negative = left.

    Declaration
    [NonSerialized]
    public float driftAngle
    Field Value
    Type Description
    float

    driftAssistStrength

    Multiplier on the drift assist force. 0 is off, 0.5 leaves drifts loose, 1 is the standard balance, 2 holds them tightly.

    Declaration
    [Tooltip("Strength of drift assist.")]
    public float driftAssistStrength
    Field Value
    Type Description
    float

    isCounterSteering

    True when player is counter-steering into the drift.

    Declaration
    [NonSerialized]
    public bool isCounterSteering
    Field Value
    Type Description
    bool

    maxDriftAssistForce

    Maximum lateral force in N applied at the rear axle to hold the drift angle. Typical: 500-1000 N light vehicles, 800-1500 N cars, 1500-3000 N heavy vehicles.

    Declaration
    [Tooltip("Maximum force that will be applied to the rear axle to keep the vehicle at or below the target drift angle.")]
    public float maxDriftAssistForce
    Field Value
    Type Description
    float

    maxyawRate

    Yaw rate threshold (deg/s) before spin-out damping activates.

    Declaration
    [Tooltip("Max yaw rate before damping kicks in.")]
    public float maxyawRate
    Field Value
    Type Description
    float

    spinOutPrevention

    Spin-out damping gain, in 1/s. The excess yaw rate decays with a time constant of 1/spinOutPrevention seconds. Torque is scaled by the body's own yaw inertia, so the same value gives the same correction on a kart and on a bus.

    Declaration
    [Tooltip("Spin-out prevention gain [1/s]. Higher = stronger correction.")]
    public float spinOutPrevention
    Field Value
    Type Description
    float

    steerAngleContribution

    Degrees added to the target drift angle, multiplied by steering input (-1 to 1), so the driver can widen the drift with the wheel. 0 fixes the angle, 10 is moderate, 20+ is loose.

    Declaration
    [Tooltip("angle that will be added to targetdriftAngle based on the steering input.\r\nIf the vehicle is drifting and there is steering input, drift angle will increase.")]
    public float steerAngleContribution
    Field Value
    Type Description
    float

    targetdriftAngle

    Drift angle in degrees the assist holds. Nothing is applied below it, so grip driving is untouched. 15-25 is grip-focused, 30-45 balanced, 50-60 show drifting.

    Declaration
    [FormerlySerializedAs("targetDriftAngle")]
    [Tooltip("angle that the vehicle will attempt to hold when drifting.\r\nForce is applied if the angle goes over this value. If the angle is below the drift angle, no force is applied.")]
    public float targetdriftAngle
    Field Value
    Type Description
    float

    throttleAngleContribution

    Extra drift angle allowed when on throttle.

    Declaration
    [Tooltip("Additional drift angle when on throttle.")]
    public float throttleAngleContribution
    Field Value
    Type Description
    float

    yawRate

    Current yaw rate in degrees/second.

    Declaration
    [NonSerialized]
    public float yawRate
    Field Value
    Type Description
    float

    Methods

    VC_FixedUpdate(float)

    Updates arcade assists based on vehicle state and player input. Applies artificial steering torque and drift assistance forces.

    Declaration
    public override void VC_FixedUpdate(float DeltaTime)
    Parameters
    Type Name Description
    float DeltaTime

    Fixed time step in seconds.

    Overrides
    VehicleComponent.VC_FixedUpdate(float)

    See Also

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