# Pass-by-Reference in EventDispatcher

**URL:** <https://forums.unrealengine.com/t/pass-by-reference-in-eventdispatcher/485981>\
**Category:** Editor Scripting\
**Tags:** reference, event-dispatcher, Input, warning, unreal-engine, question\
**Created:** [July 11, 2021, 5:35pm UTC](https://forums.unrealengine.com/t/pass-by-reference-in-eventdispatcher/485981 "2021-07-11T17:35:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![noillimryM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@noillimryM](https://forums.unrealengine.com/u/noillimryM)\
**Post date:** [July 11, 2021, 5:35pm UTC](https://forums.unrealengine.com/t/pass-by-reference-in-eventdispatcher/485981/1 "2021-07-11T17:35:24Z")

</div>

Hi everbody,

I have two questions regarding the use of the `Pass-by-Reference` option for the Inputs in an `EventDispatcher` :

1. I am not quite sure to fully understand what it is used or useful for ?

For example, I have an `EventDispatcher` with the following inputs :

![343693-2021-07-09-14h01-03.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/3/0835137078336d224f10643cd9a90856f290b62d.png)

Given that my `Object` input’s type is already an `Object Reference` (what I picked from the drop-down list), what would be the difference if I would enable the `Pass-by-Reference` option then ?

1. Furthermore, I did try with and without this option to see if there was any noticeable difference, and yes there is. If I enable the `Pass-by-Reference` I get a warning which reads :

`No value will be returned by reference. Parameter 'Object'.`

**But even though** it says that “no value will returned by reference”, on the receiving end of my `EventDispatcher` I can definitely retrieve the reference and cast it to whatever I need to. It works perfectly fine and in a completely similar manner whether or not the `Pass-by-Reference` is enabled and regardless of the warning.

Questions)

1 : In which situation and why would I want to `Pass-by-Reference` something that is **already** a reference ?

2 : What does this warning mean ? There’s definitely a value which is returned since I can use/test/cast the reference whether the `Pass-by-Reference` option is used or not.

I want to emphasize I did my fair share of research on the matter, but all the informations seem to be clashing between one another. Some say it’s a long time bug, some say it’s a normal warning, some say this warning doesn’t make sense, … . So it is really hard for me to wrap my head around this option and **fully** understand what it does and if I could actually need it.

Thanks a lot in advance !!

---

<div class="post-metadata">

**Author:** ![LastGlitter](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LastGlitter](https://forums.unrealengine.com/u/LastGlitter)\
**Post date:** [October 29, 2022, 1:43pm UTC](https://forums.unrealengine.com/t/pass-by-reference-in-eventdispatcher/485981/2 "2022-10-29T13:43:53Z")

</div>

Reference is just an index.

An object that is only responsible for passing input.

For example, in loop, if the original object changes, then the object passed from the Input node will also change.

If this is not checked, the Input node remembers the variable when it is obtained, storing it for the time being.

The above is my personal understanding, not necessarily right.

In detail, you can learn:

The difference between Reference and Instance in C++.
