Cody WIP before cleanup

This commit is contained in:
2026-06-17 22:49:44 -04:00
parent 299687734f
commit abccaaa14c
7 changed files with 224 additions and 5 deletions

View File

@@ -65,22 +65,26 @@ bool ADDICharacter::Server_SpawnProjectile_Validate()
void ADDICharacter::Server_SpawnProjectile_Implementation()
{
FVector Location = GetActorLocation();
FRotator Rotation = GetActorRotation();
if (GetMesh()->DoesSocketExist("headSocket"))
Location = GetMesh()->GetSocketLocation("headSocket"); //Socket_Projectile
FRotator Rotation = GetViewRotation();
FVector Dir = GetActorForwardVector();
// GetActorEyesViewPoint(Location, Rotation);
GetActorEyesViewPoint(Location, Rotation);
Location += Dir * 55.f;
Location += Dir * 155.f;
if (!ProjectileClass)
{
GEngine->AddOnScreenDebugMessage(1, 10.f, FColor::Emerald, "No Projectile Set");
GEngine->AddOnScreenDebugMessage(2, 10.f, FColor::Emerald, "No Projectile Set");
return;
}
FActorSpawnParameters SpawnInfo;
SpawnInfo.Owner = this;
SpawnInfo.Instigator = GetInstigator();
GEngine->AddOnScreenDebugMessage(-1,10.f,FColor::Red,FString::Printf(TEXT("Server Spawning Projectile Location %f,%f,%f"), Location.X, Location.Y, Location.Z));
GetWorld()->SpawnActor<AActor>(ProjectileClass, Location, Rotation, SpawnInfo);
}