Description

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].

Steps to Reproduce
  1. Open the editor and create a new Blueprint.
  2. Add a new variable and mark it private.
  3. Create a new Blueprint that inherits from the previous Blueprint.
  4. Under the Variables view, ensure that "Show Inherited Variables" is checked.
  5. Select the inherited variable so that the details panel shows up.
  6. Observe that the default value can't be changed. However, it can be changed in UE4.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-156915 in the post.

3
Login to Vote

Unresolved
ComponentUE - Gameplay - Blueprint
Affects Versions5.0
Target Fix5.2
CreatedJun 16, 2022
UpdatedAug 26, 2022