Game Crash While loading Level With Many Prefabs

Okay… I’m Creating this game for mobile platforms. I’m Using Track Sections(like straight, left , sharp right etc…) to construct the track using an editor script. All the track sections are prefabs. The number of track sections goes more than 100s. It’s Hard to split these track sections into different levels (because it’s in development stage and i also want to test it in mobile phones). Because of this my game is experiencing crash/performance issues. Is there any other way to optimise the tracks (like generating those tracks at run time, or disabling and enabling at run time).

Note: - the track has some mesh colliders and cast shadow is set to off for the stuff that doesn’t need shadows

using System.Collections.Generic;

1 Answer

1

I guess there are many options, but the only one I can think of right now is Serialization. What you could do is Serialize the position and all data of your tracks, and then delete them when they are too far away, and get them back later once the player is close enough to see them.

Here are a few links to get you started:

So... I should build the track in editor, give an prefab id (like 1 = straight, 2 = left, 3 = right, 4 = split....) then create an .xml/.json file having the position,rotation and prefab id then instantiate it on runtime right?

And... should I just Delete it or disable it?

Thanks @PandwanFr

to explain; the purpose here is I need to check the word input against at least 60,000 words? so for example I type in the code word and it checks if the word is correct according to the list of 60,000+ words? so if the code word "password32" is typed and its not in the list then that's when the if/else part of the code takes action.. if the right word of any of the words form the list is typed then another action is taken according to the code etc etc so without the input field theres no way this can work