Title sums it up. I have been working on random generation lately. I have made it so when water is generated, there is a chance that a “water checker” is spawned. What I want the water checker to do is count the amount of water in the area to see if it is suitable for fish to spawn. Now I know how to spawn fish and all, but how would I start at a script that finds blocks with the name/Tag “Water” in a certain Radius and count them? I’m not asking anyone to write me a script, I want to learn how to do this for other things I’m going to make for random generation. Maybe if there’s a link, or steer me in the right direction. thanks.
Create new array:
C# - GameObject array = GameObject.FindGameObjectsWithTag(“Water”);
JS - var array : GameObject = GameObject.FindGameObjectsWithTag(“Water”);
And using Vector3.Distance(a,b) counting the objects which is distance from “mark” is not greater than some number.