Compare commits

..

No commits in common. "d07932771c8cccb83a019fee94677c87fd82007e" and "a2d483dcc264f6fe6da0d8cbe11d10117fd629f6" have entirely different histories.

3 changed files with 7 additions and 9 deletions

View File

@ -41,10 +41,10 @@ void UWeaponInventoryComponent::AddWeaponToInventory(TSubclassOf<AWeapon> Weapon
FActorSpawnParameters SpawnParameters; FActorSpawnParameters SpawnParameters;
SpawnParameters.Owner = GetOwner(); SpawnParameters.Owner = GetOwner();
AWeapon* weapon = GetWorld()->SpawnActor<AWeapon>(Weapon, SpawnParameters.Owner->GetTransform(), SpawnParameters); AWeapon* weapon = GetWorld()->SpawnActor<AWeapon>(Weapon, GetOwner()->GetTransform(), SpawnParameters);
if (weapon->FollowPlayer) if (weapon->FollowPlayer)
{ {
weapon->AttachToActor(GetOwner(), FAttachmentTransformRules::KeepWorldTransform); weapon->AttachToActor(GetOwner(), FAttachmentTransformRules::KeepRelativeTransform);
} }
else else
{ {

View File

@ -42,13 +42,11 @@ void ASwarmAgent::OnSwarmAgentBeginOverlap(UPrimitiveComponent* OverlappedCompon
if (!EnemyHealthComponent->GetIsDead()) if (!EnemyHealthComponent->GetIsDead())
{ {
if (AWeapon* ownerWeapon = Cast<AWeapon>(GetOwner())) if (AVampireCharacter* character = Cast<AVampireCharacter>(GetOwner()))
{ {
if (AVampireCharacter* character = Cast<AVampireCharacter>(ownerWeapon->GetOwner())) AController* ownerController = character->GetController();
{ AWeapon* ownerWeapon = Cast<AWeapon>(GetOwner());
AController* ownerController = character->GetController(); EnemyHealthComponent->TakeDamage(Enemy, ownerWeapon->Damage, nullptr, ownerController, this);
EnemyHealthComponent->TakeDamage(Enemy, ownerWeapon->Damage, nullptr, ownerController, this);
}
} }
} }
} }

View File

@ -52,7 +52,7 @@ void ASwarmWeapon::TimelineCallback(float val)
FVector Direction = FVector(0.0, 1, 0.0); FVector Direction = FVector(0.0, 1, 0.0);
FVector RotatedDirection = Direction.RotateAngleAxis(val * 360.0f + offset, FVector(0.0f, 0.0f, 1.0f)); FVector RotatedDirection = Direction.RotateAngleAxis(val * 360.0f + offset, FVector(0.0f, 0.0f, 1.0f));
FVector NewLocation = CenterLocation + (RotatedDirection * Distance); FVector NewLocation = CenterLocation + (RotatedDirection * Distance);
NewLocation.Z = 190.0f; NewLocation.Z = 140.0f;
SwarmActors[i]->SetActorLocation(NewLocation); SwarmActors[i]->SetActorLocation(NewLocation);
} }
} }