docs.unity3d.com
    Show / Hide Table of Contents

    Self

    Note
    To use Bolt, which is Unity's visual scripting solution, download it from the Unity Asset Store.

    The Self unit returns the game object that owns the machine in which the graph runs.

    Most of the time, units will default their target to self so you don't have to explicitly use this node. This means that, for example, these two graphs are equivalent:

    However, not all units support the self inline value. Those that do not will display None instead of Self in their default value field, for example the Destroy unit. In these cases, you must manually specify the connection if you mean to use Self:

    You can use the self unit even in macros even if they are not "yet" owned by a game object. The self node will represent the owner of the graph at runtime, when it's used in a machine.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023