Child blueprint gets parameters reset when changing code in parent

I think I’m late.

If you have this structure
BP_Parent

  • BP_Son_1
  • BP_Child_n+1

and you modify some variable of the parent, be it name or whatever, then all the children will lose the values of that variable.
To solve this:

1 - You create a Struct (FSetVariablesFromStruct) with the parameters you need.

In the BP_Parent
2 - You create a variable called type VFSetVariablesFromStruct (which will set the necessary variables to the parent) where all the variables that need to be set will do so from the child, they will do so through VFSetVariablesFromStruct.

3 - You can run it in the Construct or in the BeginPlay (I recommend in the Construct so you can see the changes)

Remember that if you rename or compile with any changes the VFSetVariablesFromStruct variable from the parent, all data in the children will be deleted. So try not to touch VFSetVariablesFromStruct or you will delete all the values. Surely UE5 deletes the variable while maintaining some type of reference and then resets it.

Now you can modify all the other variables of the parent, the children will not be affected.