Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by pintee · Feb 03, 2015 at 12:30 AM · game objects

General Questions about parenting game objects

This is more of a philosophical question than a technical one…

What's the point in making a hierarchy of objects? For eg. making one object a child of another.

In what cases would it be good practice to you use this technique?

Your help is greatly appreciated. Thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by InvincibleCat · Feb 03, 2015 at 01:33 AM

Parenting objects is useful for different stuffs. An easy one is making prefabs.

Most of the time you also need an object to be depend of an other one. Like if you want an object to stay in the hand of a character, it will be a child of the hand. So I don't need to do anything. If I move my hand, the object will follow it.

It is also really useful in UI. each child depend on the parents. If you want to make a grid or any different layout. As children depend on the parent, if you resize the parent, the children will respond corresponding to the settings you will put without any extra code.

There are many many ways to use hierarchy but I think this is a good overview :)

Cheers!

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image InvincibleCat · Feb 04, 2015 at 11:50 PM 0
Share

@pintee can you mark as answer please ?

avatar image
0

Answer by Derek-Wong · Feb 03, 2015 at 01:47 AM

Another example is moving group of objects. Say I have a character which consist of n sprites, if i do not group them in a gameobject, it is difficult to move them together. Try to think how difficult it is to implement a script to move those n objects, and how easy to move a single parent of these objects.

This also apply to some cases when you would like to instantiate weapons or equipments on the character, which would "moved" by the character's own animation. Say, the character is holding a sword, and his hand is moving slightly in idle animation. How can you do these effects if you don't put the weapon in the hand objects of the character as a child??

There are still many other examples, but for me the basic usage of the hierarchy is for grouping purpose, which allows me to manage them in a much easier way.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Moving an other gameobject 2 Answers

applying movement to objects separately 1 Answer

Scene optimization: Removing/Recreating gameObjects 0 Answers

High numbers of unique game objects - best practice? 1 Answer

Why does collision detection stop? 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies 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.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges