EditCondition meta on UPROPERTY with an Enum

Greetings,

Is there a way to use EditCondition meta with an enum instead of a boolean?
I know I can do this:

	UPROPERTY(EditDefaultsOnly)
	bool IsChannelable;

	UPROPERTY(EditDefaultsOnly, meta = (EditCondition = IsChannelable))
	float MaxChannelingTime;

But can I do something like this:

	UPROPERTY(EditAnywhere, Category = "Basic Properties")
	EAbilityType AbilityType;

	UPROPERTY(EditDefaultsOnly, meta = (EditCondition = "AbilityType == EAbilityType::VE_Active"))
	float ActivateTime;

Any help would be appreciated.

I see. Yeah, it’s not that big of a deal, it was just for convenience sake. Thank you for the info, though.

Nope, for that you need a DetailsCustomization. EditCondition takes no expressions (except “!”). If your Ability System is Complex enough I would go for a Details Customization, otherwise just ignore that the Value is editable.

There is a cool function CanEditChange that expands that system:
http://benhumphreys.ca/unreal/uproperty-edit-condition-can-edit-change/

1 Like

Good catch tottaly forgot about that =)

Oh! That’s pretty nice actually. I can’t wait to play around with that.

In 5.4 you can totally do that . : )
Example from my project:

UPROPERTY(EditAnywhere, meta = (EditCondition = "TraceType == ETraceType::SPHERE"), Category = "Damage Causing Trace")
float TraceSphereRadius = 100.f;