Minor - Projectile Spawning logic done

En passant par une méthode similaire à la génération de la caméra, j'ai pu faire spawner les projectiles, maintenant à partir de leur classe, je vais ajouter leur déplacement et physique dès leur initiation.
This commit is contained in:
NisemonoQ
2025-10-19 18:08:05 +02:00
parent 17c6475397
commit 5624625eda
2 changed files with 5 additions and 4 deletions

View File

@@ -59,8 +59,6 @@ void AM4_PlayerPawn::Tick(float DeltaTime)
NewLocation.Y = FMath::Clamp(NewLocation.Y, GM->Bounds.Min.Y, GM->Bounds.Max.Y); NewLocation.Y = FMath::Clamp(NewLocation.Y, GM->Bounds.Min.Y, GM->Bounds.Max.Y);
SetActorLocation(NewLocation); SetActorLocation(NewLocation);
} }
} }
void AM4_PlayerPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) void AM4_PlayerPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
@@ -100,7 +98,7 @@ void AM4_PlayerPawn::Shoot(const FInputActionInstance& Inst)
FActorSpawnParameters ActorSpawnParams; FActorSpawnParameters ActorSpawnParams;
ActorSpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButDontSpawnIfColliding; ActorSpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButDontSpawnIfColliding;
//World->SpawnActor<AM4_Projectile>(Proj, TargetPosition, SpawnRotation, ActorSpawnParams); Projection = GetWorld()->SpawnActor<AM4_Projectile>(TargetPosition, SpawnRotation, ActorSpawnParams);
} }
} }

View File

@@ -34,7 +34,10 @@ protected:
UInputAction* ShootAction; UInputAction* ShootAction;
UPROPERTY(VisibleAnywhere) UPROPERTY(VisibleAnywhere)
AM4_Projectile* Proj; AM4_Projectile* Proj;
UPROPERTY(VisibleAnywhere)
TObjectPtr<AM4_Projectile> Projection;
//bool HasShot = false; //bool HasShot = false;
float MoveSpeed = 500.f; float MoveSpeed = 500.f;