An example is to Switch on Enum and toggle a specified variable public or not.
This way we can hide / unhide the variable depending on it is used or not.
Can be also used with Branch / Select / … or anything that switches things.
The Node would more or less look like this :
Sets a variable to public. Target is Variable. Target type is Wildcard. Using boolean “Is Public”. Node would toggle the “eye” (public variable).
Might be called only in Construction Script.
Material / Material Instance looks like already having this feature using Static Bool Param / Switch.
We hope it would be possible.
Thank you in advance.
You cannot change access modifiers at runtime since they are created at compile time and will be immutable during runtime. Since construction scripts get called at runtime, this would not be possible. Even if it was possible, it would be a bad idea since it would brake all references to this variable from other blueprints. The access modifier is not only used for visibility in the editor.
But being able to set the visibility in the editor could be a useful feature though.
Well, changing the actual access modifier is impossible by design. However I definitely think it would be useful if you could change the visibility in the editor without having to set the variable to private.