Greetings,
I have a gameMode.h
/** Bot class to spawn */
UPROPERTY(EditDefaultsOnly, Category = Bots)
TSubclassOf<class ABotShipsPawn> BotClass;
and a gameMode.cpp
void gameMode::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
if (BotClass == NULL)
{
return;
}
....
ABotShipsPawn* newBot = World->SpawnActor<ABotShipsPawn>(BotClass, FVector(), FRotator());
}
I have made a blueprint of this mode and set it as the game mode of my project and I have set the Bot class property in the blueprint. The problem is I always hit this if clause (the class is NULL although I have set it in the blueprint). Why is this happening?