docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Get Attribute: hasCollisionEvent

    Menu Path : Operator > Attribute > Get Has Collision Event

    The Get Has Collision Event operator returns true if a particle has hit a surface. This attribute is only available in the Update context.

    To write to the hasCollisionEvent attribute, add a Collision Shape Block to your graph and set its Collision Attributes property to Write Punctual Contact Only or Write Always.

    Operator settings

    Setting Type Description
    Location Enum The location of the attribute. The options are:
    • Current: Gets the value of the attribute from the current system data container. For example, particle data from a Particle System.
    • Source: Gets the value of the attribute from the previous system data container read from. You can only read from this Location in the first Context of a system after a system data change. For example, in an Initialize Particle Context.

    Operator settings

    Setting Type Description
    Location Enum The location of the attribute. The options are:
    • Current: Gets the value of the attribute from the current system data container. For example, particle data from a Particle System.
    • Source: Gets the value of the attribute from the previous system data container read from. You can only read from this Location in the first Context of a system after a system data change. For example, in an Initialize Particle Context.

    Operator properties

    Output Type Description
    Has Collision Event bool The value of the hasCollisionEvent attribute, based on Location. Returns true if the particle has hit a surface, and false otherwise. If this attribute has not been written to, this Operator returns the default attribute value.

    Details

    You can only use the Get Has Collision Event operator in the same Context as the Collision Shape Block that writes to it.

    In This Article
    Back to top
    Copyright © 2026 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)