- Home /
How can i make an infinite level?
Im trying to make a game level kina like temple run. How would i go about making a level that never ends like that with the random generated things? Its not near a replica, i just want it to be a straight line. I have no idea even where to start with this. Any suggestions?
Answer by PushpaK · Dec 25, 2012 at 05:16 AM
Try to use Application.LoadLevelAdditive(level). You can use same level or different levels alternate.
Answer by cgcookie · Dec 25, 2012 at 05:17 AM
I'll admit I have not done one personally but I will do my best to give you some insight.
Store blocks of data that start and end at the same level or a gap, and using an array randomly add these to the level as the player requires them.
Hope this helps!
Answer by Imankit · Dec 25, 2012 at 05:16 PM
You can instantiate your road in a time step using Time.DeltaTime in Update... Just check your players speed and see how far your Camera's field of view you want to set and according to that you can fix a time interval to instantiate the Road or anything you want...
You can also add Random Objects in your way..
gud luck
its something like that...
float timeI = 0;
gameObject road;
void Update(){
if(timeI
timeI+-Time.deltaTime;
} if(timeI >= 5){
road = GameObject.Instantiate(your road object prefab);
road.transform.position = your previous roadObject's end position;
timeI = 0;
}
}
Answer by Imankit · Dec 25, 2012 at 05:16 PM
its something like that...
float timeI = 0;
gameObject road;
void Update(){
if(timeI
timeI+-Time.deltaTime;
} if(timeI >= 5){
road = GameObject.Instantiate(your road object prefab);
road.transform.position = your previous roadObject's end position;
timeI = 0;
}
}
Your answer
Follow this Question
Related Questions
How to make a 2D infinite random level 0 Answers
How to save a scene that you randomly generated as a new level in your build settings? 1 Answer
Randomly Generated 2D Level 1 Answer
how can i do that enemy cars start coming up from my 2nd level of the game ? 1 Answer
Infinite loop when I try to generate randomly a 2D dungeon.. 3 Answers