Quantcast
Channel: Questions in topic: "random spawn"
Viewing all articles
Browse latest Browse all 125

Random platform Generator

$
0
0
Hello, Im trying to create a random platform generator on which a character is supposed to jump higher and higher up on. but whenever i generate my map some platforms are further away or too close for a possible jump. Im wondering if anybody can help me with this Here is my code: public GameObject platform; // calls on initiation void Start() { RandomMapBuilder(); } // Random map builder void RandomMapBuilder() { // Spawn spawns for zone 1 for (int i = 0; i < 20; i++) { // Creates positions for all the ground/ platforms to spawn Vector3 SpawnPosition = new Vector3(Random.Range(-10, 10), Random.Range(0, 100), 0); Instantiate(platform, SpawnPosition, Quaternion.identity); } }

Viewing all articles
Browse latest Browse all 125

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>