I have a basic First Person character, and i want to declare a variable of type widget component.
Though my question is, besides including the #include “Components/WidgetComponent.h”
in the header file.
how do i assign a BP widget i created in unreal, to the variable i want to create ?
Overall, i need to get access to that WBP, to set the name displayed in the Widget.
Hope you understand what i mean. will upload photos if needed.
Go to YourGameName.Build.cs, and you will see line that contains array of strings. It looks something like this: PublicDependencyModuleNames.AddRange("Core"....) you need to add "UMG" in that array.
Then open your editor and Character class where you added the code above. You will see something like this, and you will be able to add any widget you want.