In UE4, "Private" for Blueprint variables was misnamed: its behavior actually meant "Protected". In other words, it can't be read or written to by external objects, but it can be by derived types. At some point during UE5's development, we lost this behavior. "Private" variables are now completely internal to the Blueprint class that defined them.
In order to fix the regression and clarify the meaning, we should add a dropdown that lists "Public", "Protected", and "Private" as visibility options. We already do this for functions, and it makes sense to continue this for variables as well. Licensees have also requested this behavior in the past.
Note that we'll need to ensure that the Header Tool, context menu, and possibly editor features use "Protected" correctly. For the upgrade path, variables that were previously "Private" should now be "Protected", since that was the expected behavior. We should also trigger a compilation error at any attempt to bypass the access level (eg: copy/paste the setter node of private variable from a base class into a derived class).
The original feature was tracked here: [Link Removed].
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-156915 in the post.
4 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 5.0 |
Created | Jun 16, 2022 |
---|---|
Updated | Apr 1, 2024 |