How to detect changes to UPROPERTY without polling or cause a SET command to be called

I want to have class member variable type, basically a enum. For discussion we will say red green or blue. Via the api users can call “setType” to set it, this will do some actions to the Actor to make it comply the rules of the type as well as set the property type.

For testing I want to be able to just set the property from the UE4 editor while running.
I can expose type directly via UPROPERTY but that circumvents the set method. I could just check every tick, but would prefer to be event driven. Is there a way to call a set method from the UE4 property editor?

No, you cannot call a set method from the UE4 property editor. A suggestion would be to make some kind of “development UI” for your game, where you put such testing capabilities, that you don’t want to have in game later. The DevUI can then easily switched of for production.

This is what I endedup doing and it worked great. Now This is a shotgun appraoch as I call setMyValue for ANY property change but I think you can detect what property has changed if you need it to be more surgical.

#if WITH_EDITOR  
void MYClass::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent)
{
	setMyValue(_sensorType, true);
	// Call the base class version  
	Super::PostEditChangeProperty(PropertyChangedEvent);
}
#endif