Child Blueprint Variables not Updating from Parent

Hi everyone!

I’m having issues with some parent and children Blueprint interaction.

I have a Parent weapon base class with a collection of variables (floats) that control Rounds current, Spare rounds, Reload time, etc…

When I make a child BP of this class and try to modify these variables (Rounds current, Spare rounds, Reload time) inside the child BP (to create the individual weapons) inside of the “Class Defaults” section, they aren’t applied when I actually run the editor and they just default back to the value set in the parent class (Default 0).

There is a temporary work around where in the child BP I expose the variables from the parent and then manually set them but re-setting all the variables I have in my base class get super tedious and defeats alot of the purpose of making the base class in the first place.

If anyone has a fix for this any help would be appreciated.

So I have a weapon master, and I set this variable to 5

image

I made a child ( by right clicking in the content browser ). Then I can show the parent variables

image

and set Ammo to 10

image

When I put one of these in the level and run - I get 10.

How are you doing it? Or rather, how do you think it should work?

2 Likes

Hello!

I create a child class for individual weapons off of a master base class just like you but then when I open the child BP I just go to “Class defaults” and change the variables directly through there. It’s worked for me so far doing this when I update texture variables for use in my widget BP. :confused:

I think that amounts to the same thing.

So when does it go wrong?

When I play in editor, all of my print outs say that the values have returned to the parent default value (of Zero).

OK, I don’t get that. Are you placing the blueprints or spawning them or…?

Placing them in world.

Same here… :roll_eyes:

Ok so a bit of testing and what I did was set them manually in the editor of the child blueprint off of “Begin Play” which made it work as I described in the OP then I ran the editor:

image

image

after stopping the editor I deleted the nodes off of “begin play” and tried to edit the class default values again and it seems to have worked:

image

image

I’m not sure why this seems to be fixing the issue…? Almost as if I’m unsticking the variable. :confused:

In any case thank you for walking through this with me.

2 Likes

Are you using Config variables by any chance?

Nope! Custom BP variables made from scratch. No where near the ini files.

Hi! Just wondering if you ever found a fix or workaround for this? It is causing severe issues in my project and I can’t find a way around it… thanks.

1 Like