Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Too many gameobjects or components ?

Discussion in 'Editor & General Support' started by krispybeans, Jan 10, 2015.

  1. krispybeans

    krispybeans

    Joined:
    Jan 10, 2015
    Posts:
    5
    Hi there

    I've been playing around with Unity and in one of the Scenes - there is alot of autogenerated Game Objects and various Serializeable classes serizlized as members to components.

    It takes 12 seconds for Unity to start the scene when clicking play, I cannot see any spike in the profiler so Im wondering Is there any limit to how many game objects can be made in a Scene ?

    I calculated that I need around 100.000 game objects with around 300.000 components for the project im doing. Is that too much ?

    Most of the components doesnt have a Update or Start method , will it still affect the performance ? The main issue is that there is alot of bindings between the components ,so im right now bound to Using one scene for this whole bunch of data.

    ( The application needs to run on iPhone 4 and up, )

    Thank you in advance.
     
  2. Kona

    Kona

    Joined:
    Oct 13, 2010
    Posts:
    208
    I'm not sure if there's a limit to max number of gameobjects per scene, but it probably depends on what those gameobjects and/or Components are and also on the memory of the device (iPhone in your case) to play it on.

    I would recommend object pooling for you though, atleast for the objects that are duplicates! :) Especially since you're developing a phone application.
     
  3. marijnz

    marijnz

    Joined:
    Sep 20, 2012
    Posts:
    67
    Yes, too much. (100.000 GameObjects with transforms, that's a lot!) Why do you need many? This is probably something you want to rethink.. ;)
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    It definitely will not work with anything remotely close to 100K objects on an iPhone 4. Maybe 1K, which would be pushing it, but 100 is far more reasonable. It's highly unlikely you actually need 100K objects; there are far better ways of doing things. If for some reason you really do, then I'm afraid you're going to have to rethink the whole idea since it's impossible on mobile hardware (and not good even on desktops as you discovered).

    --Eric
     
  5. krispybeans

    krispybeans

    Joined:
    Jan 10, 2015
    Posts:
    5
    Thank you for that :)