So all the arrays make copies now? If I want a copy I will make a gd copy. It’s important to have access to the actual elements of the array. Now “get” returns copies. And now my entire library of code needs to be rewritten totally and completely, every gd line. Thanks?
Probability of Blueprint arrays being broken and the get by ref node returning copies: 0.02%
Probability of C++ arrays being broken and accessing items returning copies: 0.00%
Probability of you doing it wrong: 99.98%
I can only assume this is about Blueprint since in C++ it’s you who has control over copying vs references…?
It would help to show what you mean exactly, especially if you believe this to be a bug.
With so little information in your post (rant?), there’s no way anyone can help you.
I think what OP means is what is shown on the attached image where I have an array with references to actors from scene but I can not set their transformations as the get method of the array only provide a copy and not the real actor. The weird part is that if I iterate using an array loop I get the real thing
That’s a misunderstanding. It’s not returning a copy of the Actor, it’s returning a copy of the pointer to the actor. Returning a reference to the pointer wouldn’t make much sense, as both pointers point to the same object. Originally the array get nodes always returned a copy of the array elements, BTW. The “get ref” node was added to make it easier to work with array of structs, since it was impossible to directly modify a struct property in an array without making a copy. For all other types, it doesn’t make much sense (and could be dangerous).