- Home /
Initiating a rich prefab runtime
Hi,
I am newbie on unity. I am facing a problem regarding game speed. I am creating a game for iPhone/iPad. My game is runner game like temple run , subway surf and agent dash. In my game logic i created different type of many path prefab. Then i stored that all prefab references to my array called prefabsArray. When game launch i select random prefab from that array initiate it and put that in my queue. I am loading 7 prefab at once. When user passed the 1st prefab i am destroying it and creating new prefab randomly and adding that in queue. so, game working over view is.
An array having number of prefabs let say 7 to 10.
On game play queue loaded with 7 prefab randomly from array.
Removing prefab from the top of queue when passed by it.
Creating new prefab again from array randomly and putting that in queue in the last.
Steps repeat 3 and 4 during whole game.
so my problem is by doing this process my game is too slow. 1st It's too jerky. 2nd when creating or initiating new prefab at run time it stuck for a second and then move. Now my question is how can i make my game smooth and solve these problems.
I am not facing problem if i load all the prefabs in scene and repeat it. but the problem is the pattern is same by doing this.
Note: My prefabs have a lot of data in that like buildings and vehicles. If i use the simple prefab having nothing in it then game also work smooth using 1st scenario.
Thanks in advance.
Your answer
Follow this Question
Related Questions
Ampersand in application name 4 Answers
Unity3d www.progress not working in iOS 2 Answers
WWW error on ios 1 Answer
How to Use Activity Indicator in Unity3d 1 Answer
Pinch vs. Rotate gestures: can they be made size/resolution-independent? 2 Answers