Physics object that simulates the behavior of a wheel.
    public class VehicleWheel : Spatial

This node needs to be used as a child node of VehicleBody and simulates the behavior of one of its wheels. This node also acts as a collider to detect if the wheel is touching a surface.

Inheritance Chain

Constructors

    public VehicleWheel()

Properties

    public float Brake { get; set; }

Slows down the wheel by applying a braking force. The wheel is only slowed down if it is in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the RigidBody.Mass of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking.

    public float DampingCompression { get; set; }

The damping applied to the spring when the spring is being compressed. This value should be between 0.0 (no damping) and 1.0. A value of 0.0 means the car will keep bouncing as the spring keeps its energy. A good value for this is around 0.3 for a normal car, 0.5 for a race car.

    public float DampingRelaxation { get; set; }

The damping applied to the spring when relaxing. This value should be between 0.0 (no damping) and 1.0. This value should always be slightly higher than the DampingCompression property. For a DampingCompression value of 0.3, try a relaxation value of 0.5.

    public float EngineForce { get; set; }

Accelerates the wheel by applying an engine force. The wheel is only speed up if it is in contact with a surface. The RigidBody.Mass of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration.

Note: The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears.

A negative value will result in the wheel reversing.

    public float Steering { get; set; }

The steering angle for the wheel. Setting this to a non-zero value will result in the vehicle turning when it’s moving.

    public float SuspensionMaxForce { get; set; }

The maximum force the spring can resist. This value should be higher than a quarter of the RigidBody.Mass of the VehicleBody or the spring will not carry the weight of the vehicle. Good results are often obtained by a value that is about 3× to 4× this number.

    public float SuspensionStiffness { get; set; }

This value defines the stiffness of the suspension. Use a value lower than 50 for an off-road car, a value between 50 and 100 for a race car and try something around 200 for something like a Formula 1 car.

    public float SuspensionTravel { get; set; }

This is the distance the suspension can travel. As Godot units are equivalent to meters, keep this setting relatively low. Try a value between 0.1 and 0.3 depending on the type of car.

    public bool UseAsSteering { get; set; }

If true, this wheel will be turned when the car steers. This value is used in conjunction with VehicleBody.Steering and ignored if you are using the per-wheel Steering value instead.

    public bool UseAsTraction { get; set; }

If true, this wheel transfers engine force to the ground to propel the vehicle forward. This value is used in conjunction with VehicleBody.EngineForce and ignored if you are using the per-wheel EngineForce value instead.

    public float WheelFrictionSlip { get; set; }

This determines how much grip this wheel has. It is combined with the friction setting of the surface the wheel is in contact with. 0.0 means no grip, 1.0 is normal grip. For a drift car setup, try setting the grip of the rear wheels slightly lower than the front wheels, or use a lower value to simulate tire wear.

It’s best to set this to 1.0 when starting out.

    public float WheelRadius { get; set; }

The radius of the wheel in meters.

    public float WheelRestLength { get; set; }

This is the distance in meters the wheel is lowered from its origin point. Don’t set this to 0.0 and move the wheel into position, instead move the origin point of your wheel (the gizmo in Godot) to the position the wheel will take when bottoming out, then use the rest length to move the wheel down to the position it should be in when the car is in rest.

    public float WheelRollInfluence { get; set; }

This value affects the roll of your vehicle. If set to 0.0 for all wheels, your vehicle will be prone to rolling over, while a value of 1.0 will resist body roll.

Methods

    [Obsolete("GetBrake is deprecated. Use the Brake property instead.")]
    public float GetBrake()

Getter for Brake

    [Obsolete("GetDampingCompression is deprecated. Use the DampingCompression property instead.")]
    public float GetDampingCompression()

Getter for DampingCompression

    [Obsolete("GetDampingRelaxation is deprecated. Use the DampingRelaxation property instead.")]
    public float GetDampingRelaxation()

Getter for DampingRelaxation

    [Obsolete("GetEngineForce is deprecated. Use the EngineForce property instead.")]
    public float GetEngineForce()

Getter for EngineForce

    [Obsolete("GetFrictionSlip is deprecated. Use the WheelFrictionSlip property instead.")]
    public float GetFrictionSlip()

Getter for WheelFrictionSlip

    [Obsolete("GetRadius is deprecated. Use the WheelRadius property instead.")]
    public float GetRadius()

Getter for WheelRadius

    [Obsolete("GetRollInfluence is deprecated. Use the WheelRollInfluence property instead.")]
    public float GetRollInfluence()

Getter for WheelRollInfluence

    public float GetRpm()

Returns the rotational speed of the wheel in revolutions per minute.

    public float GetSkidinfo()

Returns a value between 0.0 and 1.0 that indicates whether this wheel is skidding. 0.0 is skidding (the wheel has lost grip, e.g. icy terrain), 1.0 means not skidding (the wheel has full grip, e.g. dry asphalt road).

    [Obsolete("GetSteering is deprecated. Use the Steering property instead.")]
    public float GetSteering()

Getter for Steering

    [Obsolete("GetSuspensionMaxForce is deprecated. Use the SuspensionMaxForce property instead.")]
    public float GetSuspensionMaxForce()

Getter for SuspensionMaxForce

    [Obsolete("GetSuspensionRestLength is deprecated. Use the WheelRestLength property instead.")]
    public float GetSuspensionRestLength()

Getter for WheelRestLength

    [Obsolete("GetSuspensionStiffness is deprecated. Use the SuspensionStiffness property instead.")]
    public float GetSuspensionStiffness()

Getter for SuspensionStiffness

    [Obsolete("GetSuspensionTravel is deprecated. Use the SuspensionTravel property instead.")]
    public float GetSuspensionTravel()

Getter for SuspensionTravel

    public bool IsInContact()

Returns true if this wheel is in contact with a surface.

    [Obsolete("IsUsedAsSteering is deprecated. Use the UseAsSteering property instead.")]
    public bool IsUsedAsSteering()

Getter for UseAsSteering

    [Obsolete("IsUsedAsTraction is deprecated. Use the UseAsTraction property instead.")]
    public bool IsUsedAsTraction()

Getter for UseAsTraction

    [Obsolete("SetBrake is deprecated. Use the Brake property instead.")]
    public void SetBrake(float brake)

Setter for Brake

    [Obsolete("SetDampingCompression is deprecated. Use the DampingCompression property instead.")]
    public void SetDampingCompression(float length)

Setter for DampingCompression

    [Obsolete("SetDampingRelaxation is deprecated. Use the DampingRelaxation property instead.")]
    public void SetDampingRelaxation(float length)

Setter for DampingRelaxation

    [Obsolete("SetEngineForce is deprecated. Use the EngineForce property instead.")]
    public void SetEngineForce(float engineForce)

Setter for EngineForce

    [Obsolete("SetFrictionSlip is deprecated. Use the WheelFrictionSlip property instead.")]
    public void SetFrictionSlip(float length)

Setter for WheelFrictionSlip

    [Obsolete("SetRadius is deprecated. Use the WheelRadius property instead.")]
    public void SetRadius(float length)

Setter for WheelRadius

    [Obsolete("SetRollInfluence is deprecated. Use the WheelRollInfluence property instead.")]
    public void SetRollInfluence(float rollInfluence)

Setter for WheelRollInfluence

    [Obsolete("SetSteering is deprecated. Use the Steering property instead.")]
    public void SetSteering(float steering)

Setter for Steering

    [Obsolete("SetSuspensionMaxForce is deprecated. Use the SuspensionMaxForce property instead.")]
    public void SetSuspensionMaxForce(float length)

Setter for SuspensionMaxForce

    [Obsolete("SetSuspensionRestLength is deprecated. Use the WheelRestLength property instead.")]
    public void SetSuspensionRestLength(float length)

Setter for WheelRestLength

    [Obsolete("SetSuspensionStiffness is deprecated. Use the SuspensionStiffness property instead.")]
    public void SetSuspensionStiffness(float length)

Setter for SuspensionStiffness

    [Obsolete("SetSuspensionTravel is deprecated. Use the SuspensionTravel property instead.")]
    public void SetSuspensionTravel(float length)

Setter for SuspensionTravel

    [Obsolete("SetUseAsSteering is deprecated. Use the UseAsSteering property instead.")]
    public void SetUseAsSteering(bool enable)

Setter for UseAsSteering

    [Obsolete("SetUseAsTraction is deprecated. Use the UseAsTraction property instead.")]
    public void SetUseAsTraction(bool enable)

Setter for UseAsTraction

Tags: