• 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
Question by rjdfhorn2006 · Nov 17, 2011 at 03:03 AM · androidiosperformancehardware

Empty game objects - too much?

Is it bad to have a lot of empty game objects for your game? I am working on a side-scroller and utilize empty game objects alot - primarily for moving enemies and platforms between two points (e.g., 5 enemies would mean 10 empty game objects). I plan to build t$$anonymous$$s game for iPhone and Android devices so i'm trying to improve performance in anyway possible.

Comment
kira911911

People who like this

1 Show 0
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

3 Replies

· Add your reply
  • Sort: 
avatar image

Answer by Mox.du · Nov 17, 2011 at 03:32 AM

There shouldn't be performance impact with empty game objects cause they are only pivot points in space (X,Y,Z), unless you have like million of those :).

But for moving object between 2 points I would use programming, or Tween class.

Comment
aldonaletto
reddtoric
kira911911

People who like this

3 Show 0 · 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

Answer by Eric5h5 · Nov 17, 2011 at 03:46 AM

The only performance impact I can t$$anonymous$$nk of that empty game objects would presumably slow down Find commands to some extent, but you shouldn't be doing those a lot anyway.

Comment
rutter
reddtoric

People who like this

2 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 POLYGAMe · Feb 04, 2014 at 01:41 AM 0
Share

Sorry to bump this but I am doing a racing game that has huge courses. I'm going to have hundreds of waypoints which are just empty game objects. This shouldn't affect performance?

EDIT: Make that thousands.

avatar image rutter · Feb 04, 2014 at 01:51 AM 0
Share

@POLYGAMe Your scenario isn't inherently a problem, but it's reaching a point where certain operations may be expensive enough to cause a performance hiccup. Be careful to avoid unnecessary lookups, especially anything that might require an O(n) operation against GameObjects in the scene.

avatar image

Answer by Lenvanthis012 · Jan 23, 2021 at 08:19 PM

@rjdfhorn2006 Among other reasons not to create too many game Objects, there is a limit in the number of game objects you can create in one scene. Some reported a crash after creating 16K or so, some say the limit was 5000. (Refer https://answers.unity.com/questions/365552/why-would-you-use-a-scriptable-object-versus-an-em.html?_ga=2.88130203.1241098326.1611400501-548920451.1586375942) In any case, it is not desirable to create too many game objects even if they are empty, as others mentioned, since it will undermine the performance overall.

Comment

People who like this

0 Show 1 · 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 Max_Bol · Feb 15, 2021 at 07:44 PM 0
Share

I can safely point out that there's no actual limit to the amount of game object you can add to a scene for as long as their relevant memory allocation doesn't exceed the devices memory.

To put it bluntly, an empty game object comes with a tiny overhead of a few bits (for its object ID which is used as reference by the Engine) and a total of 9x 16+2 bits float value. In other words, each empty object is approx. 162 bits + its overhead and that's in a built game.

Remember that, in the case of the Editor, there's a bigger overhead since each game object may also generate a UI icon in the Hierarchy window. The one way of reducing this overhead is to set a proper parenting system with grids within grids. Most of the people's crash comes from this single point where they generate 5000+ game object in a way that makes them appear right into the editor's Hierarchy and, that in particular, is heavy.

I'm currently working on a game that generate, at this moment, a grid with 1,000,000 empty game objects with a parenting system of 100 per "layer". • 100 squares per Block (10x10 squares) • 100 Blocks per Zone (10x10 blocks) • Map has 100 Zones. (10x10 zones)

In reference and size, 1 zone is 1km x 1km while 1 game's unit = 1m relatively speaking. All is managed by a script, but instead of calling it through the Awake() method, I'm passing the creation through a Coroutine as it allows me to pass the instantiation through more than 1 single overpacked frame.

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Does assetbundle work well with mobile devices? 1 Answer

Profiling on mobile, how to get performance time values without vsync time included? 0 Answers

Mobile game - should I reduce my vertex count? 1 Answer

Android performance VS IOS 1 Answer

FPS of up-to-date action game on mobile devices? 60 vs 30 FPS? 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