system
1
I have a foreach loop that instantiates a tile in a random range Vector3. When I instantiate the object it is inside the other ones and it flickers and causes massive lag. How do I make it not instantiate the object there again if its already there?
@SYNYST3R1 : hey its very simple to make don’t get tense.
just changing the position of instantiated objects in vector3.
here is sample :
var prefab : Transform;
for (var i : int = 0;i < 10; i++) {
Instantiate (prefab, Vector3(i * 2.0, 0, 0), Quaternion.identity);
}
it’ll instantiate every object 2 units apart from x axis.
Refer this:
http://unity3d.com/support/documentation/ScriptReference/Object.Instantiate.html