I noticed that TransformAccessArray.Add(int)
doesn’t behave in the same way as TransformAccessArray.Add(Transform).
When you add 0
, the first overload ignores it and its length doesn’t increase. But when you add null
, the second overload does increases its length.
This is breaking my code. I tried to replace the usage of .Add(Transform)
with .Add(int)
to use the Burst compiler, but now I realise the behaviour is not the same. If the integer overload doesn’t accept the “null” (0) transforms, I’m forced to have additional native arrays and jobs to sync any result that I get in whatever job the transformaccessarray is used as it doesn’t match the same sequence of elements that I have.
I guess this is a bug, since the documentation doesn’t specify that .Add(int)
ignores 0.
I reported the bug a minute ago. I make this thread to see if more users struggle with this like me.