I face this strange situation where I modified the value of a variable of a BP Actor Component and when I get it from the owner BP I don’t get the same value as the one I see in the scene.
I am stuck with that and the more I play with it and the more I am wondering if this is working correctly.
What do you think?
Here is a project illustrating my issue.
Thank you for any help
I’ve taken a look at your test project and have seen the behavior that you’re experiencing. This is intended behavior, because the value that you have set on the exposed variable on that instance in the level is not updated until Begin Play. This means that the Construction Script would not contain the updated value, because it is executed before Begin Play. If you’d like to use the value that you are setting on that instance, you’ll have to do this after Begin Play.
Have a great day,
The thing is I am working on editor tools, so it is really intended to do everything in the construction script and not through events.
Is there a way to get the value of my component variable from the BP, as it is the case with the BP actor variable?
I really need to be able to get it in order to do the tool I am working on.
Thank you very much
The only way that you’d be able to get it would be to either set the default value of the variable you’d like to use or to set the variable in the construction script. The variable that is set on the instance of the component technically doesn’t exist until the game begins.