I am having the strangest problem ever.
Error: no operand “=” matches these operands,
operand types are: TSubClassOf = ARainDrop *
I have attempted two strategies for fixing the same problem, both failing on nearly the same error.
Strategy One
RainGameMode.h
UPROPERTY(EditDefaultsOnly, Category = RainDropClass)
TSubclassOf<class ARainDrop> RainDropClass;
RainGameMode.cpp
ConstructorHelpers::FObjectFinder<UBlueprint> RainDropBlueprint(TEXT("Blueprint'/Game/FirstPerson/PlayerAssets/RainDrop_BP.RainDrop_BP'"));
if (RainDropBlueprint.Object) {
RainDropClass = ObjectInitializer.CreateDefaultSubobject<ARainDrop>(this, TEXT("RainDrop"));
}
RainDropClass cannot equals ObjectInit…etc
Strategy Two
RainGameMode.h
UPROPERTY(EditDefaultsOnly, Category=RainDropClass)
class ARainDrop* RainDropClass;
RainGameMode.cpp
ARainDrop* const SpawnedRainDrop = World->SpawnActor<ARainDrop>(RainDropClass, SpawnPosition, FRotator::ZeroRotator);
Using this strategy solves the above error, however the error then exists within the world->spawn… because of ARainDrop* is not a valid parameter (RainDropClass = ARainDrop*).
Neither of these strategies work.
This is a problem. I would like to generate objects dynamically in my scene.
Thanks for any help.