[Solved] New to C#, can anyone explain to me how enums and setting variables for enums works? [closed]

An enum is basically a special type that lets you define named values. You’re creating a named type just as you would if you were defining a class. What your code is actually doing is first defining your enumerated type called States with all the possible named values, then declaring a variable “myState” using the … Read more

[Solved] My custom terrain generation plugin instantiates to much prefabs

Firstly, change your 25 lines of Instantiation to this: for (int i = -2; i< 3; i++) { for (int j = -2; j < 3; j++) { Instantiate(terrains[Random.Range(0,terrains.length)], Vector3(j*50, 0, i*50), Quaternion.identity); } } Secondly, you already have the gameobject in this call, so don’t use GameObject.Find() //it’s expensive So assuming the object that … Read more