In Script Foo, I instantiate prefab Bar which has 3 children. From Script Foo I update a script on each of Bar's 3 children and set their variable X. When debugging I can see that all this is happening correctly.
Script WTF is attached to prefab Bar. From Script Foo, I tell Script WTF to access the scripts attached to Bar's 3 children and get what seem to be 3 new classes where variable X is never set.
I just ran some test and found that from Script WTF:
GetComponentsInChildren<TEST>()
will return an array with length 0 when it should get 3.GetChild(0).getComponent<TEST>()
will return the Script I'm looking for, but Variable X is not set.
This must have something to do with cloning, right?