UPROPERTY(EditDefaultsOnly,Category="Player")
TSubclassOf<ASWeapon> StarterWeaponClass;
FActorSpawnParameters SpawnParams;
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
if (StarterWeaponClass)
{
CurrentWeapon = GetWorld()->SpawnActor<ASWeapon>(StarterWeaponClass, FVector::ZeroVector, FRotator::ZeroRotator, SpawnParams);
}
if (CurrentWeapon)
{
CurrentWeapon->SetOwner(this);
CurrentWeapon->AttachToComponent((USceneComponent*)GetMesh(),FAttachmentTransformRules::SnapToTargetNotIncludingScale,"WeaponSocket");
}