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
2
Question by Bowserkoopa · Jul 20, 2011 at 12:48 PM · rotationtransformchildren

Rotate transform without rotation the children

I need a function, that just rotates the parent of a hierarchy and not its children. Is there a function that could do that? Else, would it be a good idea, to put all childs into an array, then detach the children, rotate the parent and then put them back into it?

Comment
Add comment · Show 1
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 Bowserkoopa · Jul 20, 2011 at 12:52 PM 0
Share

As a little side note: Just one children shouldn't rotate with the parent.

1 Reply

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

Answer by almo · Jul 20, 2011 at 01:54 PM

I am questioning if you really want the children on the parent if you need to rotate the parent independently.

Maybe attach the children to another object instead, and have that object update its position to be the same as the parent. That way the children update to the new object's position, which updates to the "parent"'s position. But when the "parent" rotates, the others don't.

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 Mirzero · Aug 16, 2012 at 03:25 AM 1
Share

He was probably hoping there was an easy way to lock the rotation since if you set it as a child, Unity automatically translates the transform for you to keep it in sync with it's parent.

Otherwise, you have to set up a 'target' object that you constantly move to the player object, and set the camera as a child of that. It's just messier.

Also, taking a total stab in the dark here... wouldn't unity's built-in transform updates probably be more performant than any attached to the object with a script? I'm not sure this will ever be a significant amount of processing... but I'm curious anyway.

avatar image Mirzero · Aug 16, 2012 at 03:48 AM 0
Share

To clarify, attaching the camera to a sibling of the target, and moving the sibling to the same transform as the target, seems to be the best result.

You can do some funky stuff with resetting the rotation, etc. but it seems to cause some really strange and terrible jerky behaviour you don't want.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Child-objects are not properly 'transformed' with parent 1 Answer

I have a gun model made up of multiple parts, attached to a rotating transform. Parts are transforming separately. (Images) 4 Answers

how to ignore transform.position.y 3 Answers

how can i get Y rotation of Transform in degree ?? 1 Answer

Why do grouped Terrain objects move together but don't rotate as one? 1 Answer


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