Blueprints derived from c++ classes not updating properly
Build Version: 4.10.0-2758231
Description: It seems that in some cases blueprints are not getting updated after hot-reloads (or their variables are not initialized to accommodate new variables or changes in existing ones) This is mostly noticeable when adding methods to OnComponentBeginOverlap via AddDynamic(...) (and I believe this is true for other events too), and I've got some weird behavior with default subobjects a few times too. I haven't been able to come up with any reliable way of reproduce described behavior, even though I've come across this issue multiple times during past few days.
In the case with subobjects becoming null, output log had something about serialized properties being NULLed during hot-reload. However, even while log stated that object was re-instantiated successfully, ubobject was null without any way of recovering. Bug seems to be similar to this bug report: link
As a workaround, issue can be fixed/avoided by simply renaming the variable each time the class is changed, but it gets annoying quite quickly.
Bug with the AddDynamic(...) is described here: link. However, the strange part is how this seems to happen seemingly at random, thus making debugging these issues a horrifying mess, especially if large quantities of newly written code is involved.
Further trying to investigate this issue, I still haven't been able to find a reliable way of reproducing the behavior, at least not in a fresh project. In existing project however, every time a new UPROPERTY is added (or removed) to certain classes, existing references to those classes are getting NULLed during hot-reload, and new instances are not getting instantiated. The only way to generate a new instance is either re-create the blueprint or to rename the property containing the reference to the NULLed component.
According to logs, it seems that serialization is treating the class as a new class after adding/removing the UPROPERTY.
After which hot-reload proceeds as expected, until:
As additional notes, UProjectileSpawnerComponent is a UActorComponent and is added via CreateDefaultSubobject<>(...) to the AcoOPCharacter. Nothing special, that is.
What comes to the other part of the issue (Events and AddDynamic(...)), it seems to have vanished, as I haven't been been able to reproduce it anymore.
I was having this issue in 4.13 after adding OnComponentBeginOverlap.AddDynamic(...) to a component. I was able to solve it by
Then opening the project file, which will force a rebuild. After that it all works, I just can't touch the AddDynamic function or it will break again.
answered Oct 13 '16 at 10:52 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here