component being set to null after change
hello, having a character set up in c++, i added a c++ component to it and initialized it in the constructor.
the character is inherited in a blueprint.
Today i change few of the properties inside this component and built the project using VS. after the build was successful, the output log in the editor pointed a warning the the reference will be nullptred and indeed, inside the blueprint derived from the character, the component's details window is empty, and starting the game will cause a crash stating that SkillCastingComponent is null.
this is not the first time it happens. in the first time it happened i deleted the character blueprint and created a new one. in the rest of the times i changed the property name (i.e from SkillCastingComponent to SkillCastingComponent2) and it worked.
i cant keep doing this cause as you imagine, it will mess up the references inside the blueprint. is there any way to avoid this?
asked Dec 11 '18 at 04:03 PM in C++ Programming
It happened to me several times too. This is the problem of hot reload and whenever you edit a serialized data (UPROPERTY or UFUNCTION) in C++ there's a chance for hot reload going wrong.
My way to avoid it is just being extra cautious when dealing with serialized data. For example closing the editor before compiling if the code involves UPROPERTY changes. Make separated commits for code and binaries.
Also if you can reproduce the issue consistently you should just send a bug report to Epic and let the engine team fix it.
Follow this question
Once you sign in you will be able to subscribe for any updates here