I have a simple pointer to an actor in my character. I wish to spawn an actor of the same class as this variable, which is called PrimaryWeapon. Here is my attempt:
GetWorld()->SpawnActorGetClass()->StaticClass()>
(PrimaryWeapon->GetClass(), FVector::ZeroVector, FRotator::ZeroRotator);
Unfortunately, this returns the following errors:
‘UWorld::SpawnActor’: no matching overloaded function found.
‘UWorld::SpawnActor’: invalid template argument for ‘T’, type expected.
In light of this, what is the correct way write the code?