I’m attempting to create a list of Transforms filled from a variable that changes every FixedUpdate:
IEnumerator FillList(){
for (int i = 0; i < listItems; i++) {
transformList.Add(newTransform);
yield return new WaitForFixedUpdate();
}
}
The variable “newTransform” is changing every FixedUpdate, but when I fill the list it fills every item on the list with the same value, instead of adding the new updated value and keeping the old ones.
Any ideas on how to add a new value every loop?
I’ve also tried
transformList.Insert(i, newTransform);
I’ve tried both using a struct and a separate class to do something like:
transformList.Add(new TranPositions(newTransform));
Yet I keep getting the same results. Any help would be greatly appreciated!
Thank you!