Engine thinks Property is not set when set in Editor

Currently I have a UPROPERTY in a C++ class as follows:

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Citizen")
		AActor* Bed;

This serves as a reference to this actor’s bed.

Then, in game, I set the dropdown list to the proper actor. This is fine for a while.

However, after a few compiles or a certain amount of time (I am unsure what triggers this) I get the following error:

IE:Error: Error Blueprint Runtime Error: Attempted to access missing property. If this is a packaged/cooked build, are you attempting to use an editor-only property?

If I simply hit “compile” in the offending blueprint, all is fixed (even though there was no change), but this is quite annoying if I have many blueprints that use this variable.

This tends to especially happen in blueprints relating to behavior trees (BTT, BTS, etc).

Is this an issue with HotReload/UE4 compiling? Or is there another way to get around this?

Here’s an image showing that the property is set despite the error:

202432-variable+assigned.png

Har to tell but yes could be Hotreload related. Close the Editor Compile your Project from VS. Try again. If that did not do the trick nuke the Intermediate folder and Compile from VS again. Report back if that solved it for you.

Its a dumb problem, and it’s still happening. But I did make a plugin that helps fix this:

It refreshes and recompiles all blueprints, so after the error occurs, just hit “Refresh All Blueprint Nodes,”
and it will fix it.

Hope this helps