I have a QuestManager header which contains this TAarray that contains my Quest object.
TArray<AQuest*> currentQuest;
and my my QuestManager constructor, I am trying to add a new object to this TArray
currentQuest.Add(NewObject<AQuest>(*findRow->questName, *findRow->questDescription));
But here is where I keep getting this error:
Error 1 error C2665: ‘NewObject’ : none of the 2 overloads could convert all the argument types
and this is my output
C:\Users\daniel\Documents\Dark Rising Studios\DRSDEPOT\Immortal Dawn[Unreal Project]\ImmortalDawn 4.9\Source\ImmortalDawn\QuestManager.cpp(26): error C2665: ‘NewObject’ : none of the 2 overloads could convert all the argument types
c:\program files\epic games\4.9\engine\source\runtime\coreuobject\public\uobject\UObjectGlobals.h(1134): could be ‘T *NewObject(UObject *,FName,EObjectFlags,UObject *,bool,FObjectInstancingGraph *)’
with
[
T=AQuest
]
c:\program files\epic games\4.9\engine\source\runtime\coreuobject\public\uobject\UObjectGlobals.h(1122): or ‘T *NewObject(UObject *,UClass *,FName,EObjectFlags,UObject *,bool,FObjectInstancingGraph *)’
with
[
T=AQuest
]
while trying to match the argument list ‘(const FString, const FString)’
this my my Quest constructor:
AQuest::AQuest(const FString qName, const FString qDescription)
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
isQuestCompleted = false;
isQuestDropped = false;
name = qName;
description = qDescription;
}
As you can see it is really simple, so I don’t know what is the problem.