Quantcast
Channel: Questions in topic: "tree"
Viewing all articles
Browse latest Browse all 513

Tree Spawning Question

$
0
0
Ok so I need to try to make tree's spawn in a area on my map so I connected a script to a single tree in my game and tried using for loops, while loops, compound for statements, everything possible they rather do one of two things lock up unity or absolutely nothing. I have referenced to the documentation of unity and still not success. But rather much of what I have already tried. Should I use a clone objected instantiate or just a standard one like I have been trying. So please if anyone has ideas let me know. using UnityEngine; using System.Collections; public class ResourceSpawn : MonoBehaviour { bool gamefirst = true; public Transform tree; void Start () { } void Update () { if(gamefirst == true) { for (int t = 0; t < 20; t++) { Instantiate (tree, Vector3(t * 8.0f, 0f, 0f), Quaternion.identity); } gamefirst = false; } } }

Viewing all articles
Browse latest Browse all 513

Trending Articles



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