How do I access the value of a C++ config var that is set in a blueprint

I have a float var setup in C++
What I want to do and have done so far is make the var available in Blueprint. And the value settable in the weapon blueprint configs. Everything so far is working but the math of taking the CurrentAmmo ( how much ammo is in the weapon currently in inventory) and the multiply it by the value set in the blueprint config.

in ShooterWeapon.h

UFUNCTION(BlueprintCallable, Category=Weapon)
	float GetCurrentMYVAR() const;

UPROPERTY(Transient, Replicated)
	float CurrentMYVAR;

FORCEINLINE float AShooterWeapon::GetCurrentMYVAR() const
	return WeaponConfig.MYVAR;

in ShooterWeapon.cpp

void AShooterWeapon::PostInitializeComponents()

	if (WeaponConfig.InitialClips > 0)
		CurrentAmmoInClip = WeaponConfig.AmmoPerClip;
		CurrentAmmo = WeaponConfig.AmmoPerClip * WeaponConfig.InitialClips;
		CurrentMYVAR = WeaponConfig.MYVAR * CurrentAmmo;


I wasnt looking at the whole picture but I see now I put it in the wrong place. I see now I will need to build a function to update itself whenever the current ammo changes. Now to figure that out.

Hi Emile,

I am glad you found a solution. Feel free to share that information in case anyone might have the same question.

Let us know if you have any specific issues as you progress.


yea when I get a good working solution I will post the code up