I’m trying to create a script wich randomly creates levels (sidescrolling) and i can get it to instantiate a random object on a given position, but i now want it to instantiate more than 1 object next to eachother (all random) but i can’t seem to figure out how to change x position (dynamically)
Here’s my source code:
var objs : GameObject;
var True = true;
var spawnLocation : Transform ;
if (True) {
Instantiate(objs[(Random.Range(0, objs.Length))], spawnLocation.position, Quaternion.identity);
Instantiate(objs[(Random.Range(0, objs.Length))], spawnLocation.position, Quaternion.identity);
}