Preserve changes made by Call In Editor event after pressing Play

I have a blueprint with a Call In Editor event which calls a function in the derived C++ class. That function sets a UPROPERTY integer TestVal to 5. I call the event in the editor and verify with a UE_LOG that the value is set to 5. When I press Play, I have another log on BeginPlay() which tells me the value of TestVal again. At this point, the value is no longer 5, but has been reset to the default value of 0.

How can I preserve the changes made in a Call In Editor function after the game begins?

2 Likes

Were you calling this function on a object instance in the world outline?
Did you save the map before you hit play?
Are you doing something else to that value in code?