How blueprint classes created from C++ classes automatically change as C++ classes change
If you mean to change a value from the C++ constructor and then automatically update the value on the Blueprint derived class, then you should simply click the yellow arrow after the value on the Blueprint class editor.
On runtime, if you access an instance of your BP class from C++, you can always change the variables that are declared on C++, because the BP is a subclass of the C++ parent class.
I hope I’ve understood correctly your question and my answer has helped!
Thank you, Scienziatogm.
i mean when i change the C++ code like add some properties or functions, i found that blueprint classes donnot change and i have to reopen the project to let BP change. I wonder if there is a way that BP can be hotreloaded when i change my code
To make changes to the headers, you’ll need to recompile outside of engine and restart. (in 4.x)
I hear 5.x supports reinstancing after live coding reload, so header changes are a thing that can happen without restarting, but I haven’t used 5.x yet.
The blueprint is essentially a map of “property name → property value.” When you add a new property to a class that a blueprint subclasses, the new C++ property will show up in the blueprint, with the default value. If you change the name of a property, the blueprint will lose the override, and revert to the default.
When you press the “compile” button (the brick box) in the toolbar, Unreal will call visual studio to re-build the DLL, and then load the new version of the DLL, and new properties will show up. HOWEVER, objects that are currently referencing the old DLL will still be referencing the old DLL – you have to force a reload of those objects, for example by closing all the windows opening instances of that class, and then re-opening them. Or, worst case, re-open the map/level.
Thank you @jwatte for helping me
Glad I could help. If this works for you, feel free to click the up-arrow icon so that others with the same question can find the answer.
you mean bookmark??