herotom99
(herotom99)
November 19, 2015, 6:32pm
1
Hello
I’m trying to create an Blueprint Widget using c++ but it doesn’t work …
public class EquipeProject : ModuleRules
{
public EquipeProject(TargetInfo Target)
{
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG", "Slate", "SlateCore" });
PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
PrivateDependencyModuleNames.AddRange(new string[] { });
------------------------------------------------------------
#include "Engine.h"
#include "Runtime/UMG/Public/UMG.h"
#include "Runtime/UMG/Public/UMGStyle.h"
#include "Runtime/UMG/Public/Slate/SObjectWidget.h"
#include "Runtime/UMG/Public/IUMGModule.h"
#include "Runtime/UMG/Public/Blueprint/UserWidget.h"
----------------------------------------------------------------------------------------------
#pragma once
#include "Blueprint/UserWidget.h"
#include "PlayerHUD.generated.h"
/**
*
*/
UCLASS()
class EQUIPEPROJECT_API UPlayerHUD : public UUserWidget
{
GENERATED_BODY()
UUserWidget* HUD;
};
Thanks !
Mattlauk
(Mattlauk)
November 19, 2015, 8:03pm
2
There’s not enough information in your post. Did you try building your project? If so and it failed, what does the output log say?
herotom99
(herotom99)
November 19, 2015, 8:25pm
3
hum hum ok it work but I can’t use my UUserWidget (“UUserWidget” is undefined)
Mattlauk
(Mattlauk)
November 19, 2015, 8:30pm
4
From the comment above, it sounds like you are all set and everything is working. One thing that I think you don’t quite understand about VS and UE4 is that intellisense will more often than not give you false positives on errors. You can not nor should you rely on it.
Mattlauk
(Mattlauk)
November 19, 2015, 8:32pm
5
I posted an answer but just for future reference, post your code using the code notation. There’s no reason to send people to another site just to see your code or even photos.
herotom99
(herotom99)
November 19, 2015, 8:36pm
6
Ok it’s not convenient … I can not program without knowing if there are errors ?
Mattlauk
(Mattlauk)
November 19, 2015, 9:14pm
7
You’ll know there are errors if it fails to compile. If it does fail to compile, the output log will let you know what’s wrong.