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

How does tree instances work?

$
0
0
I can't figure out how these work, here is the code I have. var instances = new ArrayList(); if (index >= 0) { var instance = new TreeInstance(); instance.position = new Vector3(ChunkPosX + x, height, ChunkPosZ + z); instance.color = Color.white; instance.lightmapColor = Color.white; instance.prototypeIndex = index; instances.Add(instance); } Terrain.activeTerrain.terrainData.treeInstances = instances.ToArray(typeof(TreeInstance)); The problem is that the trees doesn't show in game. I have checked that the prototypes are working and they are working just fine. NOTE: Index gets assigned by another part of the code, and its between the in game prototypes.

Viewing all articles
Browse latest Browse all 513

Trending Articles



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