# Assign vs Set By-Ref Var

**URL:** <https://forums.unrealengine.com/t/assign-vs-set-by-ref-var/587098>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, Blueprint, question\
**Created:** [June 21, 2022, 8:25pm UTC](https://forums.unrealengine.com/t/assign-vs-set-by-ref-var/587098 "2022-06-21T20:25:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![forgesheep](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@forgesheep](https://forums.unrealengine.com/u/forgesheep)\
**Post date:** [June 21, 2022, 8:25pm UTC](https://forums.unrealengine.com/t/assign-vs-set-by-ref-var/587098/1 "2022-06-21T20:25:37Z")

</div>

Within a macro a local var can be be set by either the “Assign” or the “Set By-Ref Var” nodes. Is there a difference in any way?

Also, why is the “Variable” input pin of “Assign” a regular dot instead of a diamond?

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/d/b/7db026e42f7942ac27139516dc9f5970bf43e011.png)

---

<div class="post-metadata">

**Author:** ![Grot13](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/grot13/32/1008648_2.png) [@Grot13](https://forums.unrealengine.com/u/Grot13)\
**Post date:** [June 21, 2022, 8:32pm UTC](https://forums.unrealengine.com/t/assign-vs-set-by-ref-var/587098/2 "2022-06-21T20:32:19Z")

</div>

Diamond means is it a “by-ref setting”. It can be used outside of macros, for example inside of a function it can set an external variable plugged to it (using a regular get), very handy.

I always have used “assign” to change local macro variables, I didn’t know it can be done with a “set by ref”

---

<div class="post-metadata">

**Author:** ![forgesheep](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@forgesheep](https://forums.unrealengine.com/u/forgesheep)\
**Post date:** [June 21, 2022, 9:15pm UTC](https://forums.unrealengine.com/t/assign-vs-set-by-ref-var/587098/3 "2022-06-21T21:15:19Z")

</div>

The pin shapes from “Assign” seem to be somewhat buggy (only visually as far as I can tell, the logic works as expected)

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/5/4/0543b767690532474fb0e279becfba021e62719f.png)

---

<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:** [March 11, 2026, 3:07pm UTC](https://forums.unrealengine.com/t/assign-vs-set-by-ref-var/587098/4 "2026-03-11T15:07:28Z")

</div>

> [@Grot13](#):
>
> I always have used “assign” to change local macro variables, I didn’t know it can be done with a “set by ref”

This is so strange.  
With this way i don’t need to create some variables that are only used once. use Local Wildcard node in macro and use assign node in other macro and then use these macros externally, which will work like charm.
