How can i get the array(gameobject) correctly

I use a loop to get the position of each gameobject under the array,but the position of the gameobject under the array is not obtained correctly,it gets part of the gameobjects in the array and sometimes the position of the parent object which hanging udon behaviour.


I don’t see anything wrong with what you have there. Could you post more of the graph? Can DM too if you don’t want to share everything



I used a loop to send the event "Place" to three identical perfabs in the “A1playershop” array.
these three gameobjects in public array “A1playershop” were dragged from the hierarchy


When the gameobject(single shop handle) in the array receives the event,it will run loop in four times, and generate an object(Tile) at a time.
In each loop, get the position of the object stored in the array**(TileHandle)** and set it as Tile 's position
image

Tile are randomly selected one color at a time, so there are five similar processes in udon graph

It will send 3 events to 3 Single shop Handles and generate 4 Tiles in each Single Shop Handle


A total of 3 * 4 Tiles are generated.

The result I want is like this

But the actual running result is like this,nine Tiles were created in the middle of the world,Tiles in the correct position are also overlapped

I found that when I do not randomly select colors in the loop, but directly generate a specified tile, I can get the correct results.

I used “getprogramvalue” from other udongraph to randomly select colors


It seems that this caused the confusion,but I don’t know why

The reason why the object cant be get correctly is Brach and one node as multiple inputs