# Promote To Variable Not Working Properly

**URL:** <https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327>\
**Category:** Blueprint\
**Tags:** unreal-engine, question, Blueprint\
**Created:** [August 16, 2023, 10:05pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327 "2023-08-16T22:05:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 16, 2023, 10:05pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/1 "2023-08-16T22:05:08Z")

</div>

I dont know if its the Engine or Something Ive done because for some reason I can not Promote to Variable and Reference it Any where without it Giving me a Error of (Access of None) even though it comes straight from the source. Example - Get Actor of Class and Promote it to a Variable. So now i should be able to use that promoted variable to use as a reference instead of using Get Actor of Class every time.

Is there a reason this is happening or could it be something I’ve done in my project

---

<div class="post-metadata">

**Author:** ![rokenrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rokenrock/32/1040844_2.png) [@rokenrock](https://forums.unrealengine.com/u/rokenrock)\
**Post date:** [August 16, 2023, 10:31pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/2 "2023-08-16T22:31:07Z")

</div>

Promote to variable is simply a quick-access way to make a variable and set it to whatever you’ve dragged off of. I think you’re assuming that “Promote to variable” in some way links the return value to that variable or whatever, but it doesn’t do anything that fancy- it’s just a quality of life feature. It doesn’t do anything you can’t see, and it’s all done when you click that button- not at runtime.

> [@AreWeGaming](#):
>
> Example - Get Actor of Class and Promote it to a Variable. So now i should be able to use that promoted variable to use as a reference instead of using Get Actor of Class every time.

Yes. Promote to variable created a variable and added a set node to your blueprint graph. _**Assuming that set node fires (at runtime)**_ and the actor it found isn’t deleted, it will be valid. Keep in mind that it also isn’t guaranteed to find anything- if you don’t have an actor of that class in your level when it’s fired, it won’t record anything.

Trying to access the variable before that set node has been fired would also cause an access of none error.

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 16, 2023, 10:36pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/3 "2023-08-16T22:36:03Z")

</div>

I know how they work and all that, its just for some reason anything I promote to a variable does not work. Like inside my Game Instance I have a HUD being created and when i call it on the level BP its saying the Add to Viewport access none even though its on the screen

---

<div class="post-metadata">

**Author:** ![rokenrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rokenrock/32/1040844_2.png) [@rokenrock](https://forums.unrealengine.com/u/rokenrock)\
**Post date:** [August 16, 2023, 10:39pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/4 "2023-08-16T22:39:47Z")

</div>

Hmm- that’s odd.  
If you could provide screenshots of that from start to finish and a screenshot of your variable bar, I’ll try to see what’s wrong.

Screenshots of your GetActorOfClass problem would also be appreciated.

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 16, 2023, 10:42pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/5 "2023-08-16T22:42:13Z")

</div>

![e3f64942f4b2d7dcbe9f9c7ebe7864de](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/f/4af7a062dc205339e525f1445c04347d1e8875c0.png)  
 ![903881f69e5d45a95e9dd9ec64e6f2b1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/f/f/1ffd3af048990cc71bf1aabc95a891ba7c228b94.png)

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 16, 2023, 10:42pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/6 "2023-08-16T22:42:55Z")

</div>

Level BP

 ![1d60fff1131907fbb02765442062eaea](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/a/b/3ab82abe7db2ff7205b8192ce8c64c95ec9a05d0.png)

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 16, 2023, 10:43pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/7 "2023-08-16T22:43:54Z")

</div>

Anything I Do for some reason I have to CastTo or Get Actor Of Class just to make things work by referencing something

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 16, 2023, 10:44pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/8 "2023-08-16T22:44:11Z")

</div>

Variable no longer work

---

<div class="post-metadata">

**Author:** ![rokenrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rokenrock/32/1040844_2.png) [@rokenrock](https://forums.unrealengine.com/u/rokenrock)\
**Post date:** [August 16, 2023, 10:58pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/9 "2023-08-16T22:58:29Z")

</div>

> [@AreWeGaming](#):
>
> ![e3f64942f4b2d7dcbe9f9c7ebe7864de](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/f/4af7a062dc205339e525f1445c04347d1e8875c0.png)

I have no clue what could be wrong here. Try clicking on the magnifying glass next to “Add to Viewport” in the error message. Make sure the node causing an error is actually that one.  
Widgets are some of the most annoying things to get rid of- I’m not sure how that could’ve happened.

Also make sure you don’t have two variables that are very similarly named. You can’t make duplicate variable names, but you can have spaces:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/c/f/fcf8ebc0dc98581413b95f4c075c7be7c8a41f32.png)  
All different variables, just with a different number of spaces following the “HUD”

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 16, 2023, 11:05pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/10 "2023-08-16T23:05:45Z")

</div>

The error just takes me to the Add to viewport and Its the only variable in my Instance right now

---

<div class="post-metadata">

**Author:** ![rokenrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rokenrock/32/1040844_2.png) [@rokenrock](https://forums.unrealengine.com/u/rokenrock)\
**Post date:** [August 16, 2023, 11:30pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/11 "2023-08-16T23:30:00Z")

</div>

That might be the cause of your issue. This logic should be in the player controller, not the game instance.  
I could see that becoming an issue when changing levels, trying to reference a widget that only exists in the previous level.

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 16, 2023, 11:31pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/12 "2023-08-16T23:31:31Z")

</div>

Im only playing the one level, Its a Test Map

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 16, 2023, 11:34pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/13 "2023-08-16T23:34:33Z")

</div>

But thats not my real issue  
When i Promote anything to a variable I get the same thing,  
Access of None  
You’ve done a CastToThirdPersonCharacter or whatever and promote it to a variable on a begin play or something.  
I cant do that, its just says Accessed None

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 16, 2023, 11:38pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/14 "2023-08-16T23:38:25Z")

</div>

When I start the Game with my character on Begin Play this should 100% work like normal  
 ![09471978dbd9fe354c29072017562c64](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/1/f/41f4f9759fa829b8d41119fa9d1a837670242ec4.png)

How you would use it  
 ![c3ddde3521dd5592bfa1ac8003ea4ae8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/0/e/c0e2be2253918e4472b2ff8a231d8a47bbc7202c.png)

Error

 ![a545f621e369ca467089df33796e15a3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/9/5/09550064413fc2105b67df7c8b98e8b0308fd1ea.png)  
but this happens with anything I promote

---

<div class="post-metadata">

**Author:** ![rokenrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rokenrock/32/1040844_2.png) [@rokenrock](https://forums.unrealengine.com/u/rokenrock)\
**Post date:** [August 16, 2023, 11:40pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/15 "2023-08-16T23:40:15Z")

</div>

Weirder and weirder.  
This almost seems like a case of having two editor windows open at once. Often causes a lot of issues like this. Could you relaunch the editor and make sure you don’t have any other unreal thing open in task manager?

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 16, 2023, 11:40pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/16 "2023-08-16T23:40:49Z")

</div>

If that was the case i wouldn’t be able to save

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 16, 2023, 11:41pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/17 "2023-08-16T23:41:58Z")

</div>

But No I checked

---

<div class="post-metadata">

**Author:** ![rokenrock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rokenrock/32/1040844_2.png) [@rokenrock](https://forums.unrealengine.com/u/rokenrock)\
**Post date:** [August 16, 2023, 11:45pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/18 "2023-08-16T23:45:27Z")

</div>

You are able to save even with two instances open, it just causes other issues.  
But it seems like that wasn’t the case anyways. If you’re comfortable with it, you could DM me the project and I could take a look directly-

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/d/e/1dede27418b094267caa434f69cf11c6ec217821.png)

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 16, 2023, 11:47pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/19 "2023-08-16T23:47:07Z")

</div>

Thats the thing, what project. its just a Thirdperson normal default map and a character

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 16, 2023, 11:47pm UTC](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327/20 "2023-08-16T23:47:19Z")

</div>

I have nothing but a character and animation

[Next page](https://forums.unrealengine.com/t/promote-to-variable-not-working-properly/1263327.md?page=2)
