docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IContactEventHandler

    Default implementation required to register a Rigidbody with a RigidbodyContactEventManager instance.

    Namespace: Unity.Netcode.Components
    Assembly: Unity.Netcode.Runtime.dll
    Syntax
    public interface IContactEventHandler
    Remarks

    Recommended to implement this method on a NetworkBehaviour component

    Methods

    ContactEvent(ulong, Vector3, Rigidbody, Vector3, bool, Vector3)

    Invoked by the RigidbodyContactEventManager instance.

    Declaration
    void ContactEvent(ulong eventId, Vector3 averagedCollisionNormal, Rigidbody collidingBody, Vector3 contactPoint, bool hasCollisionStay = false, Vector3 averagedCollisionStayNormal = default)
    Parameters
    Type Name Description
    ulong eventId

    A unique contact event identifier.

    Vector3 averagedCollisionNormal

    The average normal of the collision between two colliders.

    Rigidbody collidingBody

    If not null, this will be a registered Rigidbody that was part of the collision contact event.

    Vector3 contactPoint

    The world space location of the contact event.

    bool hasCollisionStay

    Will be set if this is a collision stay contact event (i.e. it is not the first contact event and continually has contact)

    Vector3 averagedCollisionStayNormal

    The average normal of the collision stay contact over time.

    GetRigidbody()

    Should return a Rigidbody.

    Declaration
    Rigidbody GetRigidbody()
    Returns
    Type Description
    Rigidbody
    In This Article
    Back to top
    Copyright © 2024 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)