C++ class doesn't show up in blueprint menu

My UUserWidget class does not show up as an option in the editor when I try to create a blueprint? Something I did or is it a problem with my unreal install.

ab099fe313b96f5e6989f5bd4be2c9d9.png

Rename the class to UWidgetBinder. Every class extending from UObject needs the ‘U’ prefix.

How did you create your class? Did you create in Visual Studio?
It is missing the ‘U’ prefix as posted by @Recursoft and some includes:


#pragma once

#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "WidgetBinder.generated.h"

UCLASS(Abstract)
class UWidgetBinder : public UUserWidget
{
    ...
}

Well I tried it out and it seemed to remedy some things but when I went to generate the source file using the editor it breaks the whole project and throws errors inside a bunch of unreal internal classes. Any time I use the “Create New C++ Class” in the file drop down menu, it breaks the whole project, even if I don’t even touch the generated files. This engine is a real pain in the *** when I can’t even begin to code because their own stuff keeps halting me, very frustrating.

Add this to your KeyBindings.Build.cs:


PublicDependencyModuleNames.AddRange(new string] { "UMG" });

When you use UMG, you need to include its Module.

You can check this in the APIas Module:

https://docs.unrealengine.com/en-US/…get/index.html

NOTE: It is ALWAYS better to create C++ files in Unreal, especially if you are just starting out.

Unfortunately putting the “UMG” in my dependencies didn’t solve it like I was hoping. I have spent a few years with c++ and have looked at engine code before but I’m wondering is this my fault somehow? Am I just really stupid? I get even more errors now. I literally haven’t even touched any of the code except for adding this class and changing that dependency. Why is this so hard and why does no one else seem to have any problems with this engine?

You forward declared your UTextBlock class but you are not including it.
If there are more errors could you post your .h and .cpp files that you have changed?

https://docs.unrealengine.com/en-US/…ock/index.html

Okay, I attached them. Thank you for giving it a look.

Add this to your Build.cs:


PrivateDependencyModuleNames.AddRange(new string] { "Slate", "SlateCore" });

Add this to your .cpp:


#include "WidgetBinder.h"
#include "Components/TextBlock.h"

If there are still errors, the problem is different, probably the version you are using, but they should be resolved in the other post you created.

Thanks for trying it must be something else. I’m going to try and reinstall Unreal Engine I guess and remake the project. I made the other one because I didn’t think any one would respond to this one so I thank you for that. Not really sure what the hell is wrong but it seems like any time I try and get back into software I get blown the hell out with problems just like this that are unrelated to my actual code.

If possible use the latest version, some versions of Unreal work with specific versions of Visual Studio, but I don’t know much about it.

going to update to the newest unreal I was on 4.14. Hopefully the newest is compatible with VS 2015

Updating to 4.2 and VS 2017 fixed the problem I guess my unreal install was buggered.