Create widget in c++

Hey @Kryst-ian, welcome to the forums!
The only issue I can see is your auto typing - it itself is not a type, but a placeholder for one. I cannot be used in certain casts or operators, so my only recommendation is to possibly have your button typed as a UButton. You may have this already since I can’t see your header file, but this is the only problem I can see within your code.
I also found a question from a while back whose answer might show you something to spark your thoughts: Create widget in pure C++ - #2 by Shohei
I hope this can help!
-Zen