docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method TryRemoveParent

    TryRemoveParent(bool)

    Removes the parent of the NetworkObject's transform

    Declaration
    public bool TryRemoveParent(bool worldPositionStays = true)
    Parameters
    Type Name Description
    bool worldPositionStays

    If true, the parent-relative position, scale and rotation are modified such that the object keeps the same world space position, rotation and scale as before.

    Returns
    Type Description
    bool
    Remarks

    This is a more convenient way to remove the parent without having to cast the null value to either GameObject or NetworkObject

    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)