Promote To Variable Not Working Properly

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

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.

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.

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

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.


Level BP

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

Variable no longer work

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
All different variables, just with a different number of spaces following the “HUD”

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

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.

Im only playing the one level, Its a Test Map

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

When I start the Game with my character on Begin Play this should 100% work like normal
09471978dbd9fe354c29072017562c64

How you would use it
c3ddde3521dd5592bfa1ac8003ea4ae8

Error


but this happens with anything I promote

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?

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

But No I checked

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-

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

I have nothing but a character and animation