When having a blueprint that inherits form a C++ AActor
class. Let’s assume you change a rotation of a USceneComponent
in the actor’s constructor, some things happen:
- On hot reloading/live coding
- Existing BPs will not update the component rotation to its new value. The value will remain the same as before the hot reload.
- Existing BPs will not even change the default value for that component’s rotation. The little arrow to the right on the Transform/Rotation section of the Details panel to reset the value to its default will not appear, meaning not even the default value for that component’s rotation was updated.
- Creating new BP that inherits from the said actor class will have the default value for the component’s rotation that was defined in the new version of the actor’s constructor.
- On editor reloading
- Existing BPs will not change the value of that component’s rotation, but will update the default value for the rotation object, meaning the “reset to defaults” button will appear in the Details panel.
- Existing BPs will update their default values for the component’s rotation, meaning that any value that was the default before the change will get its new default value. For instance, if the component had a rotation (pitch, yaw, roll) of (0, 0, 30) and we modify the pitch to 60, as it had the default value (0) before, it will update to 60 as it’s now the new default for that.
Either when hot reloading and when restarting the editor, the actor’s constructor of either existing BPs and newly created BPs will be called as expected.
The problem is that existing BPs won’t update their default values for component values after changed in the base actor c++ class when hot reloading. The problem doesn’t seem to be in the hot reload itself, as new BPs will reflect the hot reloaded version of the actor class. The problem seems to be that existing BPs doesn’t update correctly when hot reloading their base c++ class.
Possibly related: post, bug report UE-13304