ShooterGame Demo. Retrieving "CurrentAmmoInClip" from C++ in Blueprint

I’m trying to retrieve the “CurrentAmmoInClip” data from the C++ Class “Shooter Weapon” (C++ Classes, Shooter Game, Public, Weapons" in order to use this information as an RTPC in Wwise (to change the sound of the gun as ammo decreases).

I’ve looked around for an answer and have been guided to add the variable to the blueprint editor using:

/** current ammo in clip */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category=Ammo)
int32 CurrentAmmoInClip;

Which successfully adds this to the config of the weapon, but it doesn’t allow me to create a node that will retrieve the data. Am I missing something? It seems I’ve done everything I need to, As far as I can tell from this guide:

Any ideas? Sorry if this is really simple, I’m quite new to C++.

I think you need to add EditAnywhere or BlueprintReadWrite to the UPROPERTY to edit the variable in the blueprint, currently, you can only read the variable in blueprints

I don’t need to edit the variable though, I simply want to be able to use the number. This is a great example:

Whereby “Music Skill Level” would be “CurrentAmmoInClip”. I can’t seem to allow it to create the node for this. I assume it has to be a reference? Similiar to “reference to self”, but the node simply isn’t there to be added to the blueprint.

you can try to add VisibleAnywhere but i don’t really have any idea.

or compile your project inside visual studio the ue4 compile work sometimes not right

Have you Context Sensitive on or off ? when you search for the variable.

I’ve tried with both Context Sensitive on and off. This really has stumped me haha