I think you need create a uclass inside of the file.
UCLASS()
class UMyClass : public UWhatever
{
GENERATED_BODY()
};
That looks horrible…
it must be like this:
Maybe you need create a new project and migrate your assets if you have a previuos work.
the .generated.h
is for UCLASS()
#include (HeaderName).generated.h //<---
UCLASS() <---
class UMyObject : public UObject
{
GENERATED_BODY() // <---
}
those 3 <---
are the rules of using UObject
based class
I was trying to use UENUM. Is there a better way?
By the way I get an error when I use UCLASS
u need to write UCLASS()
or UENUM()
then define the class or enum, then the .generated.h
error can go away
- Sometime, in visual studio will just show error in
.generated.h
, but it compiles - I noticed
UENUM()
also show error - maybe u need
#include CoreMinimal.h
i include it and still got the same error
You have an empty space before the filename… remove it
wrong → " filename.h"
Ok → “filename.h”
Thank you for the help, but this did not help anything. I think the problem is in include search paths I tried hard, but it did not work, even though the person whose courses I was watching did not make any of these mistakes
Do you have arabic characters in your file path?
If so… remove it
no dont have
For a enum you don’t need the generated file…
in fact you don’t need any include file.
This is an example:
oh thanks
You are wellcome!!
The generated files is only needed for:
UCLASS() and USTRUCT()
Remember that