How to find object by position?
Only way i found is to use foreach, but there is no foreach function, so i tried to make it myself but i dont understand how to use these function (GetComponent,GetComponents).
Can anyone help me?
For example i need to get all cubes but dont get gameobjects on this image
The list of objects you have should be accessible by element number, 0 through X.
list
variable:
[0] Object 1
[1] Object 2
[2] Object 3
You can use the for loop and have it start at 0 (first element). Then for the End, plug in the length of the list (3), minus 1 (2). Then, you access each object with the number ouput by the for loop
variable. (loop[0]
through loop[2]
)
Not 100% sure how to go about doing that with the noodle system, though. (I tend to use U#) May need to change the GameObject
variable for Cube on the left to GameObject[]
if that’s an option to make it a list. Then you’d access that variable with the loop number.