Hello,
I have a little problem:
When I try to spawn a bluepint class in c++ I get this error:
Error C2664 'AActor *UWorld::SpawnActor(UClass *,const FTransform *,const FActorSpawnParameters &)': cannot convert argument 2 from 'FVector' to 'const FVector *'
My code:
.h:
UPROPERTY(EditAnywhere, Category = "Projectle Spawner")
UArrowComponent* ProjectleSpawner;
UPROPERTY(EditAnywhere, Category = "Projectle Spawner")
UClass* Projectile;
.cpp:
in constructor:
ProjectleSpawner = CreateDefaultSubobject<UArrowComponent>(TEXT("Projectle Spawner"));
static ConstructorHelpers::FObjectFinder<UClass> ProjectileBlueprint(TEXT("Blueprint'/Game/Blueprints/Projectile.Projectile'"));
if (ProjectileBlueprint.Succeeded())
{
Projectile = ProjectileBlueprint.Object;
}
and then later, when i try to spawn an actor:
GetWorld()->SpawnActor(Projectile->StaticClass(), ProjectleSpawner->GetComponentLocation(), ProjectleSpawner->GetComponentRotation());
I already tried many things, but nothing works.
What did I do wrong? Thanks in Advance