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
8
Question by OP_toss · Mar 27, 2015 at 10:17 PM · unity5scalelagframerate

Huge Lag issues when scaling deep hierarchies

As the title says, I'm getting huge drops in FPS when I scale the root GameObjects in my tree. I have a very big tree (~200 children limit, each with ~200 children). While this operates fine and I'm doing plenty of optimizations to draw less, I'm getting huge lag issues when attempting to scale this tree.

I've profiled it extensively and the largest cost is in BehaviourUpdate at 93%, taking 335ms. Within that the top entry is EventSystem.Update() taking 334ms, so somewhere in here is my issue. Within that is CanvasRenderer.OnTransformChanged with 137886 Calls, but only 2.7ms.

alt text

 |Tree <-- This has a Canvas object on it in worldspace
 | - Root <-- Scaling this
     | - 200 children
         | - 200 per child

Each child is a GameObject with like 10 or so GameObject children, only 2 of which use the new UI system.

My framerate drops to like 1 or 2 while scaling the Root object, or all of it's children.

Things I've tried:

  • I've tried SetActive(false) on all children when scaling, but that seems to have no impact on the lag. The lag increases exponentially with the number of children. No difference.

  • Toggling enabled and active states of all UI elements in each child. No difference.

    My Configuration:

Unity 5 Web Player build Windows 7 with decent graphics card

My Questions:

  1. Should I be worried about the 137886 Calls even if the time is only 2.7ms?

  2. Does SetActive have no affect on reducing transform calculations, particularly those caused by scaling?

  3. Is uniform scaling really just not possible to do with such complex and large hierarchies?

  4. Anything else I should try?

Edit:

So I was able to remove the lag only by moving the children outside of the hierarchy, and disabling so they've invisible. SetActive apparently has no impact on transformation changes. I'd prefer to keep them visible though, and therefore scale them, so still open to advice!

ontransformchanged-profile.jpg (82.2 kB)
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by kanyka · Jan 21, 2017 at 08:53 AM

Possibly you can set camera to position to closest round number. it's work for me.

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

hi-polys ??? frame lag when instantiating prefab of rigidbodys 1 Answer

Physics issue with Unity scaling and Hololens 0 Answers

Why does simple animation make my game lag? 2 Answers

Change grid scale or scale whole library 0 Answers

Why does holding down any button cause ~20-30 FPS loss? 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