• 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 /
  • Help Room /
avatar image
0
Question by manifolded · Jun 26, 2018 at 02:33 AM · transformsceneparent

Shortcut to create empty parent with transform of original object?

I would think this would be a common enough problem that there would be a shortcut.

Suppose you place a GameObject in your scene and get it adjusted just the way you want it. Then you realize that you are going to add some other objects and you would like for them all to be under one empty parent. In particular you would like to align them according to the local coordinates of this parent.

Having placed the first object, is it possible to create an empty parent object with its transform taken from the first?

I've been laboriously copying over the position, rotation and scale values by hand and I feel certain that there must be a better way.

Comment
Add comment · Show 3
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 tormentoarmagedoom · Jun 26, 2018 at 08:14 AM 0
Share

I thnk there is no shortcut, but in this cases, i create a script. ITs simple to add a script to several objects at once. :D

avatar image manifolded · Jun 26, 2018 at 08:44 AM 0
Share

@tormentoarmagedoom - I'm confused. Can a script play the same role as a parent object?

avatar image tormentoarmagedoom manifolded · Jun 26, 2018 at 10:13 AM 0
Share

No xd!

I mean, if you have multiple objects that needs the same "correction", and you dont want to make it by hand 1 by 1, you can create a script for all of them to make it via code, so don't need to do it by hand.

But anyway, i make you an answer now :D

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by tormentoarmagedoom · Jun 26, 2018 at 10:16 AM

Good day.

there is no shortcut for this (or at least i never saw it or listen/read about it)

The best way is to create an empty object child of the original object, set it transfom (Local position) to 0,0,0 . Then by inspector icheracty, move it outside (unparent it) the original object and make the original object child of the emptyobject.

So you will finnaly have a emptyObject with the coorect world position and the originalobject as a child with coords 0,0,0

Bye!

Comment
Add comment · Show 2 · 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 manifolded · Jun 27, 2018 at 02:35 AM 0
Share

That's crazy, but it's great. I'm going with it.

avatar image manifolded · Jun 27, 2018 at 02:38 AM 0
Share

Still, I argue Unity should totally add a "Create Parent" option to the contextual menu for GameObjects.

avatar image
0

Answer by mvriel · Jun 27, 2021 at 05:12 AM

I came here from Google and while reading this I came up with a solution that might help anyone else in the future:

After adding the empty parent:

  1. select your child object

  2. Right click on the 'position' label in the Inspector and choose Copy.

  3. Right click again on 'position' label and choose Revert

  4. Select your parent object

  5. Right click on the position label in the inspector and choose Paste.

Voila! The position has now been applied from the child onto the parent. It may not be the most desired outcome but beats having to reposition the parent manually.

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
avatar image
0

Answer by mfatihbarut · Feb 27 at 05:51 AM

There is a shortcut to "Create empty parent" now. (in Unity 2021)

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

178 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 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 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 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 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 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 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 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 avatar image avatar image

Related Questions

Inventory Master DragItem.cs Error Cant change transform parent of a object that resides in a prefab? 0 Answers

Parent's transform changed when attaching child 2 Answers

Set parent of an object when they collide? 2 Answers

Notify a script that a transform has changed its parent 1 Answer

How to set the transform.position of a GameObject after making it a child? 0 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