# Can't Set Default Value in variable

**URL:** <https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449>\
**Category:** Blueprint\
**Tags:** default-value, unreal-engine, Blueprint, question\
**Created:** [December 25, 2014, 6:47pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449 "2014-12-25T18:47:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xendran](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xendran](https://forums.unrealengine.com/u/Xendran)\
**Post date:** [December 25, 2014, 6:47pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/1 "2014-12-25T18:47:53Z")

</div>

When i try to set the default value of itemBP here: [http://puu.sh/dJ6tu/bccdb7b6d2.png](http://puu.sh/dJ6tu/bccdb7b6d2.png)

Clicking it does nothing and leaves it as None.

---

<div class="post-metadata">

**Author:** ![mindfane](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mindfane/32/710746_2.png) [@mindfane](https://forums.unrealengine.com/u/mindfane)\
**Post date:** [December 26, 2014, 3:22am UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/2 "2014-12-26T03:22:02Z")

</div>

Can you describe the problem? A

---

<div class="post-metadata">

**Author:** ![Xendran](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xendran](https://forums.unrealengine.com/u/Xendran)\
**Post date:** [December 26, 2014, 7:39am UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/3 "2014-12-26T07:39:36Z")

</div>

I have a masterConsumableItem blueprint which is an actor, and I make children of it for each item.

Inside these blueprints is an itemMasterStruct variable ThisItem which contains info about the item. When i add a variable to itemMasterStruct of a reference to masterConsumableItem, it does not let me actually set a value for it.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [December 26, 2014, 8:50pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/4 "2014-12-26T20:50:22Z")

</div>

Hi ,

At the bottom of your “My Blueprint” pane should be a checkbox that says “show inherited variables”. Select that to be able to access your variable. You should be able to adjust the values in your child blueprint without affecting your master blueprint here.

---

<div class="post-metadata">

**Author:** ![Xendran](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xendran](https://forums.unrealengine.com/u/Xendran)\
**Post date:** [December 26, 2014, 10:11pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/5 "2014-12-26T22:11:16Z")

</div>

Check the screenshot, i have that checked. All the other variables inside the struct variable work.

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [December 26, 2014, 10:20pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/6 "2014-12-26T22:20:24Z")

</div>

Is this a variable that takes in an already spawned actor? Try placing this Blueprint in the scene and access the Variable over the Property Window at the right side of UE4. There you should be able to assign something to this variable.

EDIT: Here are some pictures of what i mean. Made a test Struct with an Actor Reference:

[http://puu.sh/dKw1L/e75967108c.png](http://puu.sh/dKw1L/e75967108c.png)

I can’t set the Actor in the Blueprint default at the bottom. So i dragged it into the scene (spawned it) and on the right sight i can fill the struct:

[http://puu.sh/dKw4U/98a3685b1e.jpg](http://puu.sh/dKw4U/98a3685b1e.jpg)

Does this help you?

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [December 26, 2014, 10:29pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/7 "2014-12-26T22:29:49Z")

</div>

I added 2 Screenshots. Make sure the Struct variable is marked as “Editable”

---

<div class="post-metadata">

**Author:** ![Xendran](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xendran](https://forums.unrealengine.com/u/Xendran)\
**Post date:** [December 26, 2014, 10:36pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/8 "2014-12-26T22:36:43Z")

</div>

When i place it on the map it appears to be initially set, but upon playing a failed cast shows otherwise (as does the editor after exiting PiE).

If i then try to set the itemBP, it resets all of the values inside of thisItem [http://puu.sh/dKwJ5/9eb25b53d5.png](http://puu.sh/dKwJ5/9eb25b53d5.png)

I also believe this is the culprit of a crashing issue i had before.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [December 29, 2014, 9:24pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/9 "2014-12-29T21:24:39Z")

</div>

Hi ,

Do you have a sample project that I can take a look at where this is occurring or reproduction steps that I can take to recreate this? I haven’t been able to reproduce this on my end.

---

<div class="post-metadata">

**Author:** ![Xendran](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xendran](https://forums.unrealengine.com/u/Xendran)\
**Post date:** [December 30, 2014, 5:56pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/10 "2014-12-30T17:56:40Z")

</div>

Is there a way i can send it to you privately?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [December 30, 2014, 6:23pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/11 "2014-12-30T18:23:03Z")

</div>

If you send me the link via PM on the forums I will gladly get it there.

---

<div class="post-metadata">

**Author:** ![Xendran](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xendran](https://forums.unrealengine.com/u/Xendran)\
**Post date:** [December 30, 2014, 6:30pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/12 "2014-12-30T18:30:31Z")

</div>

Okay I’ve PMed you the link to the project with steps on what i did that caused the issue.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [December 31, 2014, 5:14pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/13 "2014-12-31T17:14:30Z")

</div>

Hi ,

The struct you mentioned in your pm is not located within the project. Can you send me a copy of your struct .uasset and let me know what file it belonged in so I can get everything together? Or let me know what all is needed within the struct so I can recreate it on my end. Thank you!

---

<div class="post-metadata">

**Author:** ![Xendran](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xendran](https://forums.unrealengine.com/u/Xendran)\
**Post date:** [December 31, 2014, 5:33pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/14 "2014-12-31T17:33:01Z")

</div>

It’s in Content \> Blueprints \> Inventory. Here’s a link to the struct uasset itself, inside the folder i linked you earlier: [https://drive.google.com/file/d/0B6MprO-AJJ6jbnVRVWE4OGt4U2s/view?usp=sharing](https://drive.google.com/file/d/0B6MprO-AJJ6jbnVRVWE4OGt4U2s/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [December 31, 2014, 6:24pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/15 "2014-12-31T18:24:25Z")

</div>

Thank you , apparently that file didn’t transfer over when I pulled them. I’ll post here once I have a bit more information.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [December 31, 2014, 6:40pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/16 "2014-12-31T18:40:10Z")

</div>

Hi ,

Try creating a new version of your itemMasterStruct and see if replacing it fixes the error.

---

<div class="post-metadata">

**Author:** ![Xendran](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xendran](https://forums.unrealengine.com/u/Xendran)\
**Post date:** [December 31, 2014, 7:02pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/17 "2014-12-31T19:02:37Z")

</div>

Tried that, caused this [http://puu.sh/dTPBN/856a005fc5.png](http://puu.sh/dTPBN/856a005fc5.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [January 5, 2015, 10:07pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/18 "2015-01-05T22:07:39Z")

</div>

Hi ,

I have not been able to reproduce this on my end. Do you have any other steps that I can take to recreate the error you are seeing?

---

<div class="post-metadata">

**Author:** ![Frisco](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Frisco](https://forums.unrealengine.com/u/Frisco)\
**Post date:** [January 20, 2015, 7:08pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/19 "2015-01-20T19:08:54Z")

</div>

I’m having the same error. I can set everything else in struct exept the “item” (actor). Did you guys solve this?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [January 20, 2015, 8:16pm UTC](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449/20 "2015-01-20T20:16:19Z")

</div>

Hi ,

Are you attempting to populate the item with static meshes? Can you post a screenshot of what you have thus far?

[Next page](https://forums.unrealengine.com/t/cant-set-default-value-in-variable/302449.md?page=2)
