Loading assets and Instantiate issue

Hello. I have couple of question about the performance issues on iphone.

1- Every time player taps the screen I’m Instantiating a flying bullet image(GUI Texture-prefab) on a screen, however the problem is, every time its instantiated, it almost makes the application stop for a really short amount of time(milliseconds). But if I always keep the image on the screen and control its position instead of instantiating, it works perfectly fluid. Is Instantiate function incredibly slow on iphone? or am I making a mistake.

2- Is there any way to load prefab objects before the game starts? because as I see on my application, it doesn’t load any of the prefabs until its first Instantiate. And it makes the application really slow because its loading all the prefab objects at run time.

Thanks

  1. Instantiating is more expensive CPU wise than using a pool of objects that are all instantiated in advance. For visual effects, projectiles, enemies, or any other things you expect to create and destroy frequently, I highly recommend creating pools in advance that you store in arrays or something along those lines for maximum fluidity at run time.

  2. In Unity 3, all assets referenced in your level are pre-loaded in advance now, rather than the previous loosey-goosey method of just loading stuff the first time it shows up on camera. This should solve any stuttering you may get during run time as new textures first appear, new sounds play for the first time, etc.