Create level in unity editor or instantiate at runtime?

Hello !

I am evaluating unity at this time so sorry if my question seems stupid ^^
I want to make a kind of plateform game on the iphone. It will be a fixed camera like the 2D tutorial, but with much much more objects and use of physics on each object.
Of course it would be easier to design the levels in unity editor but even if objects or not visible they probably require physics computation right ? So the iphone may not be able to handle lots of them ?
Is it better to only instantiate the visible objects during the game ?

Thanks !

I guess it depends. If the rigidbody objects aren’t moving, they will go to sleep.

I’ve noticed in many cases that instantiating can cause a slight but noticeable freeze up. It depends on the object. Simple objects aren’t a problem, but more complex objects are.

I agree - instantiating on the iphone is slow.

I would elect to build the world using ‘bits’ and set them up as a series of prefabs such as “Level001_Prefab”, “Level002_Prefab” and load them through code.

I would also explore loading physics based objects as separate prefabs per level too: “Level001_Physics_Objects”, “Level002_Physics_Object”.

This way you get control over everything and can keep an eye on things which ‘clog up’ your performance on each level. Loading a prefab is pretty instant and there’s less coding, so you can get a ‘feel’ for how the iPhone will react quite quickly and you can break the loading of level objects into small batches, rather than all at once.

In my game soon to be released I am using a basic code framework, which loads whichever level I need as a prefab. The levels have small animations, rotations etc and all come in really quickly, so it seems very efficient.

Many thanks for your advices ! I will try with prefabs and see… :roll: