Open the BP_PlayerBuildingComponent then go to the DisablePlacement function and add a new local variale, set its name to NumMaterialsL and set its Type to Integer, then copy the image below.

Then open the EnablePlacement function and add a new local variale, set its name to NumMaterialsL and set its Type to Integer, then copy the image below.