docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct WheelClosestHitCollector

    Collector for the wheel casst hits. Stores the closest hit that is not a hit to a vehicle collider.

    Implements
    ICollector<ColliderCastHit>
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Vehicles
    Assembly: com.unity.vehicles.dll
    Syntax
    public struct WheelClosestHitCollector : ICollector<ColliderCastHit>

    Constructors

    WheelClosestHitCollector(Entity)

    Constructor

    Declaration
    public WheelClosestHitCollector(Entity vehicleEntity)
    Parameters
    Type Name Description
    Entity vehicleEntity

    The vehicle entity

    Properties

    ClosestHit

    Closest valid hit.

    Declaration
    public ColliderCastHit ClosestHit { get; }
    Property Value
    Type Description
    ColliderCastHit

    EarlyOutOnFirstHit

    Set to false as there might be invalid self hits.

    Declaration
    public bool EarlyOutOnFirstHit { get; }
    Property Value
    Type Description
    bool

    MaxFraction

    Maximum fraction of cast distance within which the hits will register.

    Declaration
    public readonly float MaxFraction { get; }
    Property Value
    Type Description
    float

    NumHits

    Number of registered hits.

    Declaration
    public readonly int NumHits { get; }
    Property Value
    Type Description
    int

    Methods

    AddHit(ColliderCastHit)

    Callback on cast hit.

    Declaration
    public bool AddHit(ColliderCastHit hit)
    Parameters
    Type Name Description
    ColliderCastHit hit

    Hit info.

    Returns
    Type Description
    bool

    True if the hit is valid.

    Implements

    ICollector<T>
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)