# Difference between get (a ref) and get (a copy)

**URL:** <https://forums.unrealengine.com/t/difference-between-get-a-ref-and-get-a-copy/481213>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [April 1, 2021, 1:03pm UTC](https://forums.unrealengine.com/t/difference-between-get-a-ref-and-get-a-copy/481213 "2021-04-01T13:03:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Unholy\_man](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Unholy\_man](https://forums.unrealengine.com/u/Unholy_man)\
**Post date:** [April 1, 2021, 1:03pm UTC](https://forums.unrealengine.com/t/difference-between-get-a-ref-and-get-a-copy/481213/1 "2021-04-01T13:03:55Z")

</div>

What is the significant difference between using “**get (a ref)**” and “**get (a copy)**” nodes?  
Especially in the context of this example:

 ![334333-blueprint.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/4/3/b4304040115b8f6a8d3b9ee0df56ae580217276d.png)

Is there a performance difference or something else?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 1, 2021, 1:14pm UTC](https://forums.unrealengine.com/t/difference-between-get-a-ref-and-get-a-copy/481213/2 "2021-04-01T13:14:52Z")

</div>

A copy is just that, a copy. But if you use get ref, any modifications you make will be written to the original.

In the first example, you don’t need to re-make the item and write it back. If you update any of the broken-out fields, that will be written back to the array element.

---

<div class="post-metadata">

**Author:** ![Unholy\_man](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Unholy\_man](https://forums.unrealengine.com/u/Unholy_man)\
**Post date:** [April 1, 2021, 7:10pm UTC](https://forums.unrealengine.com/t/difference-between-get-a-ref-and-get-a-copy/481213/3 "2021-04-01T19:10:23Z")

</div>

Thank you so much! Round pins in Break out node always confused me and i’ve never tried using Set By-Ref for variables inside before. But this is what I need!

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 1, 2021, 7:36pm UTC](https://forums.unrealengine.com/t/difference-between-get-a-ref-and-get-a-copy/481213/4 "2021-04-01T19:36:24Z")

</div>

Also check out the SetMembers node ( drag a pin off a structure to get it ).

---

<div class="post-metadata">

**Author:** ![Wontague](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/wontague/32/1008648_2.png) [@Wontague](https://forums.unrealengine.com/u/Wontague)\
**Post date:** [October 19, 2021, 1:30pm UTC](https://forums.unrealengine.com/t/difference-between-get-a-ref-and-get-a-copy/481213/5 "2021-10-19T13:30:09Z")

</div>

That’s about right, and what we’d expect, from the name and tooltip, but I’ve read Get a Copy only makes a copy for reading primitives (float, int, bool, etc.), but not so for objects.

Blueprints stores objects in arrays by pointer - like, an array of BP\_BigHeavyObject will actually have pointers to those objects - and Blueprints will only get you the dereferenced pointers, so any changes made will be to what was pointed at, that is, the original object.

So - if you use Get a Ref for an object in an array, Blueprints will change this to Get a Copy (with a misleading tooltip), but you are actually accessing the original object, not a copy.

---

<div class="post-metadata">

**Author:** ![MuddassirAhmad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MuddassirAhmad](https://forums.unrealengine.com/u/MuddassirAhmad)\
**Post date:** [November 11, 2023, 11:10am UTC](https://forums.unrealengine.com/t/difference-between-get-a-ref-and-get-a-copy/481213/6 "2023-11-11T11:10:32Z")

</div>

If You use get a (copy) then the items will not be added in this example and if you used a ref a (copy) it will add items in that like given below is an array of structure of actors array test it like that and you will find the difference.

 ![Screenshot 2023-11-11 160728](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/0/6/e0626728991d98d466be3024cecfbc2a07bde2fc.png)

---

<div class="post-metadata">

**Author:** ![blindminds](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blindminds/32/1213160_2.png) [@blindminds](https://forums.unrealengine.com/u/blindminds)\
**Post date:** [April 14, 2024, 1:22pm UTC](https://forums.unrealengine.com/t/difference-between-get-a-ref-and-get-a-copy/481213/7 "2024-04-14T13:22:36Z")

</div>

Are they they same speed to do operations on? I have a situation where I am reading from arrays, but not altering them, and writing to a new array (with new data, not same data).

If they are the same speed, I would then assume it is better to use “ref” to avoid duplicating memory usage?

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [April 14, 2024, 3:00pm UTC](https://forums.unrealengine.com/t/difference-between-get-a-ref-and-get-a-copy/481213/8 "2024-04-14T15:00:30Z")

</div>

i imagine Ref would be faster but not enough to even think about, just do what suits your code better
