hello there,
i am trying to get a spline mesh component from an array by index number.
like this with a float array:
and now with the spline mesh component array:
why i cant get a reference?
hello there,
i am trying to get a spline mesh component from an array by index number.
like this with a float array:
and now with the spline mesh component array:
why i cant get a reference?
so, to âget a copyâ doesnt mean âspawn a new componentâ ?
Hello!
This is still a reference, donât worry! Get a copy of a reference doesnât need optimization, it works well!
And also you cannot get a reference to a reference, it doesnât exist in C++ , so while you get a copy, you are directly getting a reference to the object and this last one is completely outside of the array⌠But the object is always the same.
You can get as many references of an object as you want, they are all different references but the object is always the same.
Hope it helps!
No it doesnât , the engine is well designed, you can get a real copy of a âprimitiveâ like integers because it is not dangerous to do so(copy vs references performance on primitives are not too scary, unless they are not many!)
But when we do such operations on objects (maybe giant objects) the difference exists!
A good programming design is to not allow clients to copy those objects and give a system and methods to the clients to safely do operations on the objects.
UnrealEngine do so⌠You can bet!
Nice to help!
ok. thanks for your help mate!