I found a bug today when using the construction script inside my blueprint. If you have a variable, string for example, you can’t set it from the construction script unless it is set to be “Editable”, which also exposes them to the Blueprint details in the world. The same is with local variables, and that is kind of weird, because I need to use a checking variable inside my construction script but it won’t work without making them editable.
Steps to reproduce:
Create or edit any Blueprint
Open up the construction script
Create a new variable of any type and try to set it to some value
You’ll see that it won’t take the value when you use the SET expression. Use Print Strings for testing that!
Nothing spectacular… Just like you set a variable from blueprints… No error, but as I can test with print strings, the set variable node won’t set
Edit: In normal event graphs, it works, but not in construction script .
We have not heard from you in several days. I am marking this as answered for tracking purposes. If you are still experiencing this error, please comment with the requested information.
I get what he’s saying, just ran into this myself on 4.15 - if you want to set a variable from the construction script, you have to make it “editable”, which is not always desired because that exposes it to the property window and changing it might be dangerous.
It’s not a biggie, but it’d be nice if you could set a variable in the CS without exposing it. I notice variables now have an “expose to cinematics” checkbox that allows matinee/sequencer to modify the variable - perhaps that could be extended to also allow the actor’s construction script to modify it?
I was unable to reproduce this issue in 4.15.1. I was able to set an INT variable and have it print without making the variable editable. I have a couple questions to help me narrow down this issue:
Can you reproduce this issue in a new project?
If so, could you provide a detailed list of steps so that I can reproduce this issue on our end?
I also just ran into this, in this example if you have “Instance Editable” set to true, then this works as expected and sets the variable to true. If you do not have the variable “HasRun” instance editable, then it never sets the variable to true.
Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here
You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.
This bug report was resolved as “by design”; however, that means that there is no way to track internally whether the construction script has ever run in Blueprint without exposing the variable that you use to track it to the users in the editor, which may open up the possibility of bugs if users directly change the value of that tracking variable on the instance.