I don’t seem to understand. Here’s one part of code:
// Variable to hold the widget After Creating it.
UUserWidget* MyMainMenu;
and here’s another part:
// Create the widget and store it.
MyMainMenu = CreateWidget<UUserWidget>(this, wMainMenu);
But how? Aren’t pointers only able to hold the address of a variable? I’m assuming CreateWidget is a templated class, would that be correct? How is a pointer able to point directly to it?
This is basic c/c++ stuff. An integer, a floating point, a string, an object, a widget, or anything really, is just a series of bytes in memory, pointer holds the address to that series of bytes along with the information about what kind of thing it points to.
CreateWidget is not a templated class, it is a templated function that returns a pointer to a widget.