docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PhysicsUtilities

    Various physics utilities

    Inheritance
    object
    PhysicsUtilities
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Vehicles
    Assembly: com.unity.vehicles.dll
    Syntax
    public static class PhysicsUtilities

    Methods

    HasPhysicsTag(in PhysicsWorld, int, CustomPhysicsBodyTags)

    Determines if the specified physics body has a given physics body tag

    Declaration
    public static bool HasPhysicsTag(in PhysicsWorld physicsWorld, int bodyIndex, CustomPhysicsBodyTags tag)
    Parameters
    Type Name Description
    PhysicsWorld physicsWorld

    The Physics World of the body

    int bodyIndex

    The body index

    CustomPhysicsBodyTags tag

    The physics body tag to check for

    Returns
    Type Description
    bool

    True if the body has the physics tag

    SetCollisionFilterAll(ref PhysicsCollider, CollisionFilter)

    Sets the collision filter of a physics collider, including all child colliders if it's a compound collider. Note that if the collider is not made unique, this will affect all instances of the collider.

    Declaration
    public static void SetCollisionFilterAll(ref PhysicsCollider physicsCollider, CollisionFilter filter)
    Parameters
    Type Name Description
    PhysicsCollider physicsCollider

    The physics collider to change

    CollisionFilter filter

    The collision filter to apply

    SetCollisionResponseAll(ref PhysicsCollider, CollisionResponsePolicy)

    Sets the collision response of a physics collider, including all child colliders if it's a compound collider. Note that if the collider is not made unique, this will affect all instances of the collider.

    Declaration
    public static void SetCollisionResponseAll(ref PhysicsCollider physicsCollider, CollisionResponsePolicy policy)
    Parameters
    Type Name Description
    PhysicsCollider physicsCollider

    The physics collider to change

    CollisionResponsePolicy policy

    The collision response policy to apply

    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)