Movatterモバイル変換


[0]ホーム

URL:


Version:Unity 6.0 (6000.0)
    • Supported
    • Legacy
    LanguageEnglish
    • C#

    Scripting API

    LanguageEnglish

    Collision

    class in UnityEngine

    /

    Implemented in:UnityEngine.PhysicsModule

    Suggest a change

    Success!

    Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

    Close

    Submission failed

    For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

    Close

    Cancel

    Description

    Describes a collision.

    Collision information is passed toCollider.OnCollisionEnter,Collider.OnCollisionStay andCollider.OnCollisionExit events.

    Note: The contact points are in world-space.

    Additional resources:ContactPoint.

    Properties

    PropertyDescription
    articulationBodyThe ArticulationBody of the collider that your GameObject collides with (Read Only).
    bodyThe Rigidbody or ArticulationBody of the collider that your Component collides with (Read Only).
    colliderThe Collider we hit (Read Only).
    contactCountGets the number of contacts for this collision.
    contactsThe contact points generated by the physics engine. You should avoid using this as it produces memory garbage. Use GetContact or GetContacts instead.
    gameObjectThe GameObject whose collider you are colliding with. (Read Only).
    impulseThe total impulse applied to this contact pair to resolve the collision.
    relativeVelocityThe relative linear velocity of the two colliding objects (Read Only).
    rigidbodyThe Rigidbody we hit (Read Only). This is null if the object we hit is a collider with no rigidbody attached.
    transformThe Transform of the object we hit (Read Only).

    Public Methods

    MethodDescription
    GetContactGets the contact point at the specified index.
    GetContactsRetrieves all contact points for this collision.

    Is something described here not working as you expect it to? It might be aKnown Issue. Please check with the Issue Tracker atissuetracker.unity3d.com.

    Copyright ©2005-2025 Unity Technologies. All rights reserved. Built from: 6000.0.48f1 (a9387dbd5c06). Built on: 2025-04-12.

    [8]ページ先頭

    ©2009-2025 Movatter.jp