Right, sorry. You need to cast the spawned actor to the type of the variable.
MyPistol = Cast<AWeapon>(GetWorld()->SpawnActor(PistolBP.Class))
Right, sorry. You need to cast the spawned actor to the type of the variable.
MyPistol = Cast<AWeapon>(GetWorld()->SpawnActor(PistolBP.Class))