I’ve seen this before when adding a blueprint accessible function/property to an object that is already referenced in an existing blueprint. The only work-around I’ve found is to simply tell it to not save and re-launch the editor, at which point you can have it restore the work in progress if needed and it will then save properly. Really annoying.
For couple of reasons I’m not sure if this is the case here.
First, even after closing and re-opening the editor, the problem persists.
Second, The function is not referenced anywhere else apart of what you see in the screen shot.
I downloaded your test project and attempted to reproduce what you’re encountering but I was able to save without any issue.
To be exact, after loading up the project, I made an actor blueprint and then added the ‘Create Flower Object’ blueprint node in the Constructor Script. After attaching the Constructor Script to the Create Flower Object pin, I dragged off the ‘Return Value’ pin of the Create Flower Object and selected ‘Promote to Variable’. After this, the blueprint looked like your picture does. I attempted to compile and then save without any issue.
I know your steps are pretty basic but are there any other details that may be omitted? It’s possible that I missed a step that you are taking that is causing the inability to save.
I’m doing the same, the only thing I’m sure is if you added the actor to the scene.
Things do not go wrong until you actually add the actor to the scene.
Of course it was something so simple. You were correct, the actor wasn’t in the scene. I reproduced the issue from your test project and a fresh project of my own.
I have entered your issue into our database to be fixed in a future update. For your reference, in case you ever need an update on the bug’s progress, the bug number is UE-14581.
Using CreateObject and assigning the resulting UObject to a variable in a Blueprint is not correct. The Generated UObject will be placed in the transient package while the instanced Blueprint will be in the Map’s package. The UObject reference cannot be saved because of the dependency and this is entirely expected.
If you want to create an object, you should have it’s outer be the Level. This will ensure that the instance of the Blueprint and the UObject exist in the same package when saving the map.
Something as simple as GWorld->GetLevel(0) will retrieve the global level of the current GWorld.
However, it’s not entirely advisable to use GWorld (we try and limit the use of it internally for more robust code that can utilize multiple UWorld’s).
Passing in an Actor and using GetLevel() on it will retrieve the ULevel it is a part of. You would require to have an Actor capable of being sent when you call the function, however.
You get the same error as previously posted? I cannot reproduce this issue after pulling down your project and making the change.
Check that the object created by NewObject’s outer is not the transient package (and further, that the outer’s outer and up the chain as much as may be needed, is not the transient package).
There may be some corruption due to more clean-up of the Blueprint instances already placed (if any), so you could try a new level (and perhaps a new Blueprint) to see if the issue lingers. With the code provided, the object should no longer be a part of the transient package.
I’m more curious whether or not the issue can be reproduced in an entirely new level. It’s not possible to get a new level Blueprint for an existing level. This will help us determine if there is level corruption occurring or another issue entirely.
Knowing the return UObject of that function’s outer is also important. The code is specifying the outer to be the level but if you are still getting the error message we are still creating a UObject that exists in the transient package.
Yeah, I can have a look at the current Blueprint. If it’s for the same project originally supplied, I should be able to verify whether the code change resolves the problem.
In the original supplied project, if you make the code change to use the ULevel as the Outer can you reproduce the issue still?
After the code change, there should not be a problem with references linking to the transient package. At some point in your code, a CreateObject must be letting the object be placed in the transient package. Or through some other means (DestroyObject uses may lead to the problem, or Rename).
I can’t tell what the problem is without seeing the full project or repro steps that continue to occur after the suggested code change.