Making a variable private does not undo default value changes in child blueprints

Suppose I have a base class A and a child B and A has a member ‘float’ that defaults to 1, but in B it defaults to 0. I then make float private in A because I didn’t actually intend for it to be altered by child classes. The float disappears from B, but in game it retains its default change to 0. I cannot change it back from 0 to A’s default until I make float public again and change the default back in B (it reappears with the reassigned value of 0).

Hello ,

I was unable to reproduce this issue on our end with the information provided. I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide a detailed list of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any settings/blueprints that may be involved?

Hi Rudy,

I’ve replicated this easily. In a blank project I created an actor bluprint “Base” with a float variable “Health” that defaults to 5. I also added a text render that sets its text to the value of Health on BeginPlay. From this a created a derived blueprint “Child” in which I set Health to default to 0. I then set Health to private in Base (and it disappeared from Child’s defaults list). I put an instance of both Base and Child in the level, and when I start the Base displays 5 and the Child displays 0. I can only fix this by making Health public again, resetting the default to match the parent in Child, and then changing it back to private.

Here is my setup for Base:

Here you can see I’ve set Health to 0 in child while Health is still public:

Then I set Health to private and it disappears from child:

Then I start the game and this is the result:

Hello ,

I was able to reproduce this issue on our end. I have written a report and I have submitted to the developers for further consideration. I have provided a link to the public tracker. Please feel free to use the link provided for future updates.

Link: Unreal Engine Issues and Bug Tracker (UE-50199)

Make it a great day

Hello ,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Thanks,