Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 MathijsF · Jul 31, 2018 at 01:29 PM · scenehierarchy

Drag and drop gameobject to new parent without changing local position (manually, not with script)

Attention: this question is about manually dragging objects with the mouse in the Editor, not about setting the parent through scripts!

When dragging an object in the scene hierarchy to a new parent, Unity automatically updates the local position so the world position of the dragged object remains the same.

Is there any way to prevent that? I tried holding down any combination of Ctrl / Alt / Shift while dragging, but nothing works, it always updates the local position.

Comment
Add comment · Show 2
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 marcelo_augusto · Oct 07, 2020 at 03:55 PM 0
Share

@$$anonymous$$odLunar how can I do it with multiple objects at once?

avatar image Bunny83 marcelo_augusto · Oct 07, 2020 at 07:42 PM 1
Share

You can't really do that with multiple objects.


A simply workaround is to create a temporary empty object under the old parent and move it to (0,0,0) and reset the rotation to (0,0,0). You can simply move / drag all object to that empty object. Now simply move the empty object over to the new parent. Again, simply reset the position and rotation of the object and all child objects should have the same local position / rotation. Just move the childs out of the temporary object into the new object. Finally you can delete the temporary object.

1 Reply

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

Answer by ModLunar · Jul 31, 2018 at 01:58 PM

Ah yes, this is how I do it:

Some background information:
You can right click its Transform component's header in the Inspector, you'll be able to copy the component. Later, you can then either paste a copy of that component as a new component on another GameObject (won't work with Transforms in particular), OR you can paste the component's values (at the time of the copy) into another Transform! This works with all components. It should look like this:

alt text



Here are the basic steps:
1. Before changing the GameObject's parent, right click on the Transform's header in the Inspector, choose "Copy Component".

2. Change the parent of the GameObject. The Transform's fields will change to the unwanted values, keeping it in the same world-space position.

3. Right click the GameObject's Transform header again, now choose "Paste Component Values". This should restore the local-space values (as seen in the Inspector)


transform-inspector-right-click.png (27.9 kB)
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

106 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

Related Questions

Parse Scene Hierarchy 1 Answer

Models Disappeared in Scene but shows in Hierarchy -2 Answers

Scene items are not showing in hierarchy nor in scene window in unity 5 0 Answers

Can't drag assets from Project folder to Hierarchy/Scene 2 Answers

SceneManagement creation of new scene 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