How to Add a Scene Component in C++?

I didn’t realize where you were calling the code because you didn’t show that in your problem statement. My code should work when being called outside of the constructor. Shmoopy’s code should work inside of a constructor.