As variable of a SceneComponent, when this is edited in the actor BP editor where the component is added, the value always comes back to the default value on runtime. It only happens with the FTransform, other types such as FVector works fine.
I’ve written many classes and I’ve been setting the default value in the header file, and all of them worked fine. I’ve thought of setting them in the constructor but it’s easier to them in the header file.
Anyways, I actually have tried that but it’s the same. I just put a zero value so that what I meant by back to default would be clear
Unfortunately there isn’t much “magic” that can cause a property not to be editable. Everything seems okay (without seeing the rest of the header file).
I’d check to see if UHT is complaining about anything. You could also try to clean your solution so it regenerates all the boilerplate code.
Does the same behavior occur in a new, empty project as well? I copied the code you provided into a SceneComponent class and when I set the value in a blueprint that used my scene component, the set value was printed at runtime. I was also able to set individual instances of my blueprint’s variable in the viewport.
If possible, please provide the reproduction steps to allow me to create a test project that matches your setup or a small sample project showing the issue.
We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.
I found the problem, it’s because Editable variables of object already placed in the editor will not be updated when you edit the BP variable. Which is fine I guess.