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

Questions about the Unity 2D Demo

Discussion in '2D' started by cb31416, Nov 15, 2013.

  1. cb31416

    cb31416

    Joined:
    Nov 4, 2013
    Posts:
    7
    Guys I have a question about the 2D demo made with Unity 4.3, which is awesome by the way!!!

    What are the steps to put the “Gun” prefab inside the “hero”?
    If you click the “hero” prefab in the Prefabs folder, in the inspector you cannot see the “Gun” script, but if you expand the “hero” by clicking in the small arrow in the prefab icon, you can see that it has the “Gun” prefab there.

    I want to do exactly the same thing but I can’t figure out how to get the “Gun” prefab inside the “hero”.

    Any help would be very appreciated.
     
  2. TheMitic93

    TheMitic93

    Joined:
    Jan 11, 2013
    Posts:
    10
    I think you are talking about parenting , add both "hero" and "gun" prefab to scene, they should appear in hierarchy. Then select "gun" prefab and drag it on "hero" prefab. Now "hero" is a parent prefab to "gun" prefab. That means that when you move "hero", "gun" will move along with him.
     
  3. cb31416

    cb31416

    Joined:
    Nov 4, 2013
    Posts:
    7
    @TheMitic93 that's exactly what I have been trying to figure out.

    Thanks a lot for your response :D