docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    On Collision

    The On Collision event node start to trigger when a GameObject enter in collision with the GameObject containing the visual script with the On Collision event. From there, it will execute anything chained to its control flow ports depending of the execution context you want to use.

    Note: To get the On Collision event work when working in a scene level, you absolutely need to setup your GameObjects like this: 1- The object with the visual script.

    • Component: Convert To Entity.
    • Component: Physics Shape or Any collider.
    • Component: Scripting Graph Authoring (Script) with our visual Script containing the On Collision Event. 2- The GameObject that will Enter in collision with our object having the On Collision Event.:
    • Component: Convert To Entity.
    • Component: Physics Shape with the Raises Collision Events checked in the Advanced Section.
    • Component: Physics Body or Rigidbody

    Ports

    Inputs

    Port Name Type Default Value Description
    [Boolean] True If Enabled is set to true (Checked), the On Collision Event will be triggered every time a game object collide with it or stop to collide.Instance
    [GameObject] The GameObject you want to validate that is colliding with the GameObject containing this visual script.

    Outputs

    Port Name Type Default Value Description
    Trigger Execute next action when a GameObject enter in collision with the GameObject containing the visual script.
    Trigger Execute next action when a GameObject stop to collide with the GameObject containing the visual script.
    Trigger Execute every frame when a GameObject as entered in collision with the GameObject containing the visual script and is still colliding with it.
    [GameObject] Return the GameObject Interacting with the collision.
    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)