- Home /
does Array.Concat() and Array.Push() add objects by Value rather than by Reference ?
because that's what it appears to do (even though it doesn't make much sense), but that's not what I want.
according to http://answers.unity3d.com/questions/6599/add-a-copy-of-a-object-to-array what I'm saying here is not true :s
I add an object to an array, then I move it, and I notice I have 2 objects now, one on the new position, and one on the old.
Answer by Steven-1 · Dec 26, 2010 at 08:12 PM
never mind, it appears the problem was caused by some other mistakes, which made it seem like the object was beeing cloned. so it actually had nothing to with abjects beeing passed by value
so, No, Array.Concat() and Array.Push() add objects by reference, not by value
Your answer
![](https://koobas.hobune.stream/wayback/20220613092614im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Store reference to array as variable 2 Answers
Pushing textures in an Array 2 Answers
assign string value from array to multiple game objects 1 Answer
Updating an array indices dynamically 2 Answers