How do I use PostEditChangeProperty?

/* If MyBool belongs to the ASomeActor */
void ASomeActor::PostEditChangeProperty(struct FPropertyChangedEvent& e)
{
Super::PostEditChangeProperty(e);

     FName PropertyName = (e.Property != NULL) ? e.Property->GetFName() : NAME_None;
     if (PropertyName == GET_MEMBER_NAME_CHECKED(ASomeActor, MyBool)) {
             /* Because you are inside the class, you should see the value already changed */
                if (MyBool) doThings(); // This is how you access MyBool.
                 else undoThings();

            /* if you want to use bool property */
            UBoolProperty* prop = static_cast<UBoolProperty*>(e.Property);
           if (prop->GetPropertyValue())
               dothings()
          else
                 undothings()
     }
 }
5 Likes