Create Property in c++ and let them return different values depending on WITH_SERVER macro

Hey!

I already figured this out once (I still have the node without exec pins referenced in a blueprint) and i remember i used it :&

I want to create a property IsWithEditor that I can use in blueprints. I dont want to make it a function, why does this not work:

    UPROPERTY(BlueprintReadOnly, Category = "ServerHelp")
        #if WITH_EDITOR
            bool IsWithEditor = true;
        #else
            bool IsWithEditor = false;
        #endif

I know I could just make a function but there has to be a way with it being a property…

How does it not work what is happening? Try setting this variable in constructor this is where defaults should be set by UE4 convention, maybe this deceleration messing up UHT. btw engine already has this in APIs for this, there is GIsEditor static variable and there also this: