• 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 country_dragon · Jun 26, 2014 at 09:23 PM · rotationgameobjecttransformpositionperformance

How can I defer the recalculation of child transforms whilst modifying the parent transform?

I have a situation where I need to modify the localPosition and localRotation of all child transforms belonging to a game object (of which there are many children). As far as the profiler is concerned this appears to be taking up an overly large amount of CPU time. I can only assume that setting the localPosition and/or localRotation is doing something quite expensive under the hood - like immediately recalculating the transforms of all the children. I was hoping the recalculation of the transform hierarchy would be deferred until the next time the transform is queried but I don't think this is the case. Could anybody shed some light on what setting a transform's localPosition and localRotation is actually doing behind the scenes that could cause this to be such an unexpected drain on performance. If my suspicions are correct and the child transforms are being recalculated immediately after each modification then is there a way to prevent this from happening until after I've finished modifying all the child transforms in one big batch?

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

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

postion scale and rotation greyed out and not working 1 Answer

GameObject Rotation is always postive 0 Answers

why is my object's rotation affecting it's position? 1 Answer

Syncing Position and Rotation data in ECS tests? 0 Answers

Change object position on trigger enter 3 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges