#ifndef not working

in the following code i have not defined ‘NOEXTRA’. so ‘PropertyFloat’ should be seen in editor but does not.
why?

UCLASS()
class BATTERYCOLLECTOR_API AMyActor : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AMyActor();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;


#ifndef NOEXTRA  
	UPROPERTY(EditAnywhere)
	float PropertyFloat;
#endif

};

Hey DaneshBAria-

After testing I found that #ifdef / #ifndef do appear to work inside the source file without issue, there just seems to be an issue with using it in the header file. I entered a bug report for the #ifndef not having an affect on the UPROPERTY showing in the editor (UE-28516).

Cheers

Hey , no need for filing bug report for it. It’s by-design UHT limitation: #define doesn't work with UFUNCTIONS - Blueprint - Epic Developer Community Forums

Refer to: UE-28103