docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method SetParent

    SetParent(uint, uint, bool, uint, bool)

    Set the parent of an occurrence

    Declaration
    public void SetParent(uint occurrence, uint parent, bool addInParentInstances = false, uint insertBefore = 0, bool worldPositionStays = false)
    Parameters
    Type Name Description
    uint occurrence

    The occurrence

    uint parent

    The parent occurrence

    bool addInParentInstances

    If True, each occurrence whose prototype is the target parent will generate a child whose prototype is the occurrence itself

    uint insertBefore

    Add before this child occurrence in the children list of the parent occurrence

    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.

    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)