loading

i have a game that im making for a web-player and when it loads it loads in about 2 or 3 seconds before starting to play the music, but still dosent show anything from the camera, then in about 5 seconds its starts showing what’s on camera but its lagging like crazy and going around 7 FPS for about 2 more seconds and then 16 or so FPS for 4 more seconds and then it stays at 48-50

im not quite sure how to deal with this but right now it looks really cheesy

You could show a “splash screen” for some seconds and start the music when the splash screen became visible (I don’t remember the event name, but there is), or when it disappear.

I’m guessing that one reason for the slowdown could be mesh colliders on large(ish) meshes.

In my current project I solved the problem by not using them at all. Removing the last mesh collider changed startup time from about two seconds to about a tenth of a second.

Doing without may not be an option.

So what about this. (You probably want to make a good backup of your project first) :

  • Put everything in the scene except splash screen and music into a giant prefab and remove it from the scene
  • When you are sure that the splash screen has displayed (I dunno how to do that), start the music
  • Instantiate the prefab.

This should take care of the initial blank screen
If your framerate is low during the first seconds, I am guessing that you are instantiating several objects with mesh colliders dynamically?

Maybe you could do that “hehind” the splash screen, and display a progress bar, until everything is ready?

Still, I am just guessing at what is slowing your particular game down.

i only have on large mesh for a terrain and its not a collider, its about 4000 polys which isnt that large i dont think, and then i have 4 of the basic ground meshs from standard assets, and then at least 30 standard asset cubes all with no rigidbody or colliders

but since performance insant the issue and spastic loading time is, would it be a bad idea or a good idea to use the combine mesh at runtime script for al the cubes and the ground??

Do you get the same behaviour if you run it as a Mac standalone?

  • If not, then you are right about the “spastic loading”.
  • If it is the same, the problem is “spastic startup performance”, and in that case a runtime mesh-combiner would probably make it worse.

yeah same behavior in the stand alone, thanks for your help, ill try out the splash screen thing