Hey there,
I am just starting with unreal c++ and already struggling. I followed these tutorials:
How to spawn a simple cube in C++? - Programming & Scripting - Epic Developer Community Forums
I like to create a simple actor, but I cant compile due to some error. What is wrong?
HEADER:
UCLASS()
class MYFIRSTPROJECT_API ASimpleItem : public AActor
{
GENERATED_BODY()
UPROPERTY(Category = Meshes, VisibleAnywhere)
TSubobjectPtr<UStaticMeshComponent> CubeMesh;
};
CPP:
ASimpleItem::ASimpleItem(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
CubeMesh = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("CubeMesh"));
}
Error:
**
Warnung 1 warning C4996: TSubobjectPtr is deprecated and should no longer be used. Please use pointers instead.**
**Warnung 2 warning C4996: FPostConstructInitializeProperties is deprecated and was renamed to FObjectInitializer. Please use that type instead. **
Fehler 3 error C2084: Funktion ‘ASimpleItem::ASimpleItem(const FObjectInitializer &)’ hat bereits einen Funktionsrumpf
might be translated to : “( … ) already has a body”
Thanks alot!