Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Copying button and child text from Hierachy to projects window.

Discussion in 'Getting Started' started by Relay-Unity, Aug 19, 2019.

  1. Relay-Unity

    Relay-Unity

    Joined:
    Aug 19, 2019
    Posts:
    2
    Hello everyone,

    I'm following a tutorial from unity (https://learn.unity.com/tutorial/cr...g-only-ui-components#5c7f8528edbc2a002053b4be) and at some point it askes me to:
    "Select the Grid Space GameObject in the Hierarchy Window and drag it into the Prefabs folder in the Project Window to create a new Prefab." And in the example image it shows the Grid Space gameobject with a triangle infront to display the child text.

    The problem:
    When I drag the Grid Space gameobject to the projects folder it only copies the parent and not the child object. Even when I right-click and use 'select children' to move both objects to the project folder it only moves the child object over.

    My question:
    How do I move both gameobjects from the Hierarchy to the projects folder while maintaining the parent child relationship. I am using Unity 2019.1.7f1.
     
    Last edited: Aug 19, 2019
  2. Valjuin

    Valjuin

    Joined:
    May 22, 2019
    Posts:
    481
  3. Relay-Unity

    Relay-Unity

    Joined:
    Aug 19, 2019
    Posts:
    2
    Hallo Valjuin,

    Thanks for your reply. And yes that is was is happening when I drag the object from Hierarchy to the projects folder. But as this example image shows (https://connect-prd-cdn.unity.com/2...20858e37_017_prefab_created.png.1400x0x1.webp), you want to keep the text object as a child even after dragging it to the projects folder. Notice the little triangle infront of the Grid Space gameobject. For some reason that doesn't happen.

    I think this is important because, further down the tutorial it asks to move the prefab to the Inspector window on the 'on click' field. As shown here (https://connect-prd-cdn.unity.com/2...caeb064ead5_026_drag_prefab.png.1400x0x1.webp)
     
  4. Valjuin

    Valjuin

    Joined:
    May 22, 2019
    Posts:
    481
    upload_2019-8-21_14-50-36.png upload_2019-8-21_14-51-8.png

    This is an old tutorial and I feel that you may well encounter further problems as you work through it.

    I would, therefore, recommend that you consider starting over in an older version of Unity than the one you are currently using for this project.

    The following is a screenshot from version 2017.4.25f1:

    upload_2019-8-21_19-26-48.png
     
    Last edited: Aug 21, 2019