Why doesn't GetFiringStatus() need to be a UFUNCTION?

In this lecture we added GetRoundsLeft(), and had to add the UPROPERTY macro to make it BlueprintCallable.

A few lectures earlier we added a getter GetFiringStatus() that is used by the blueprints to adjust the color of the reticle, but this getter isn’t a UFUNCTION and we are still able to access from the blueprints.

Why does GetRoundsLeft() need to be a UFUNCTION to work, but GetFiringStatus() doesn’t?

EFiringStatus GetFiringStatus() const;

UFUNCTION(BlueprintCallable, Category = "Firing")
int GetRoundsLeft() const;

We aren’t getting a GetFiringState() from the code but the enum itself

UENUM()
enum class EFiringState : uint8
{
Reloading,
Locked,
Aiming,
Empty
};

And since it is preceded with UENUM() it makes it available in blueprints.
At least I think so

Privacy & Terms