For whoever trying the great solution above but is getting complication errors.
Don’t forget to include: include “Widgets/SWidget.h” include “Widgets/SViewport.h”
Otherwise complier can’t know how to compare the two. Good luck!