Changes made in live coding only affecting instance (not defaults), what am I doing wrong?

I have a custom pawn class derived from APawn. In this class I set some variables default values in the constructor.
It was working nicely with live coding till yesterday: If I changed the values in cpp, the default values of the BP updated accordingly.

Today, however, something weird is going on. When I change values in cpp, save and ctrl + alt + f11 to do live coding recompile, the changes affect ONLY the instanced BP in the level, but not the default values in the BP itself. In my mind this makes no sense…

Before, I had the JumpZVelocity set to 700 and the MaxJumpTime set to 0.5, in the constructor (in cpp). Then I changed it to 750 and 0.3 (in cpp):


I saved and did the live coding recompile with ctrl + alt + f11. But the BP defaults did not update:


The weird thing is the instanced actor in the level updated the values, but as modified parameters (not defaults):

And no, I had not set these manually in the instanced. They changed after I changed the cpp and recompiled.

What am I doing wrong? Why aren’t the defaults updating? Why is the instance updating even though the defaults aren’t?

Under " Changing Default Values for Variables With Live Coding" in the Live Coding Documentation it says:

“When changing default values for variables, values set in the constructor implemented in the .cpp file will not update in existing instances of objects. However, if you change them in your .h file, you will see the change take place.”

Hope that helps.

1 Like