# Struct setmember not working

**URL:** <https://forums.unrealengine.com/t/struct-setmember-not-working/354984>\
**Category:** Blueprint\
**Tags:** Struct, unreal-engine, Blueprint, question\
**Created:** [April 21, 2016, 5:16pm UTC](https://forums.unrealengine.com/t/struct-setmember-not-working/354984 "2016-04-21T17:16:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Napoleonite](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Napoleonite](https://forums.unrealengine.com/u/Napoleonite)\
**Post date:** [April 21, 2016, 5:16pm UTC](https://forums.unrealengine.com/t/struct-setmember-not-working/354984/1 "2016-04-21T17:16:02Z")

</div>

So I set a boolean to false and set an integer to 1234. Yet the boolean is true and the integer is 0… How is that possible?

 ![87862-bp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/9/f/19f430730b77150bb994a1dbaa368a0efdbbc748.png)

---

<div class="post-metadata">

**Author:** ![CriErr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CriErr](https://forums.unrealengine.com/u/CriErr)\
**Post date:** [April 21, 2016, 6:00pm UTC](https://forums.unrealengine.com/t/struct-setmember-not-working/354984/2 "2016-04-21T18:00:39Z")

</div>

Struct come from array? Seams like you cannot set by reference variables from array past “get”.

---

<div class="post-metadata">

**Author:** ![Napoleonite](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Napoleonite](https://forums.unrealengine.com/u/Napoleonite)\
**Post date:** [April 21, 2016, 6:09pm UTC](https://forums.unrealengine.com/t/struct-setmember-not-working/354984/3 "2016-04-21T18:09:46Z")

</div>

So the Array.Get returns a read-only struct but throws no error when I assign something to it and allows me to setmembers in it… Oh Indeed I found it here: RA UE-6451 [https://answers.unrealengine.com/questions/212654/set-array-elam-isnt-work-at-struct-array.html](https://answers.unrealengine.com/questions/212654/set-array-elam-isnt-work-at-struct-array.html) and [https://answers.unrealengine.com/questions/276010/set-members-doesnt-work-with-array-element.html](https://answers.unrealengine.com/questions/276010/set-members-doesnt-work-with-array-element.html) Bug going back as far as UE4.4. So we can’t pass them by reference, we can’t put them inside arrays, and the other 2 workarounds are insanely complex.

Thanks for the answer. Seems that structs are simply unusable (beyond a very basic use of it) in this engine and that we have to code our own variant of it. No pass by reference, can’t be stored as reference, C++ requires a lot of UE4 knowledge to implement it there and arrays are bugged since 4.4… I’m severely disappointed in Unreal.

---

<div class="post-metadata">

**Author:** ![CriErr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CriErr](https://forums.unrealengine.com/u/CriErr)\
**Post date:** [April 21, 2016, 6:32pm UTC](https://forums.unrealengine.com/t/struct-setmember-not-working/354984/4 "2016-04-21T18:32:58Z")

</div>

There are ugly workaround for it [http://puu.sh/oqLxD.png](http://puu.sh/oqLxD.png) , but yes, its quite bad.

---

<div class="post-metadata">

**Author:** ![Napoleonite](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Napoleonite](https://forums.unrealengine.com/u/Napoleonite)\
**Post date:** [April 21, 2016, 7:43pm UTC](https://forums.unrealengine.com/t/struct-setmember-not-working/354984/5 "2016-04-21T19:43:07Z")

</div>

So you basically create & assign a whole new struct to the array-element. That’s gotta be great for performance.

I think it’s better to just drop stucts all together and just not use them. They are badly implemented by the Unreal devs. C++ or blueprints with public variables are better imo.

---

<div class="post-metadata">

**Author:** ![CriErr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CriErr](https://forums.unrealengine.com/u/CriErr)\
**Post date:** [April 21, 2016, 7:55pm UTC](https://forums.unrealengine.com/t/struct-setmember-not-working/354984/6 "2016-04-21T19:55:47Z")

</div>

This would not affect you, that performance hit.

---

<div class="post-metadata">

**Author:** ![Jonas\_Molgaard](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jonas\_Molgaard](https://forums.unrealengine.com/u/Jonas_Molgaard)\
**Post date:** [September 3, 2016, 11:09pm UTC](https://forums.unrealengine.com/t/struct-setmember-not-working/354984/7 "2016-09-03T23:09:31Z")

</div>

Seriously not fixed in ue4.13 yet? This gotta be something they have to look into. It’s a major bug.
