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:
@@ -59,8 +59,6 @@ void AM4_PlayerPawn::Tick(float DeltaTime)
|
||||
NewLocation.Y = FMath::Clamp(NewLocation.Y, GM->Bounds.Min.Y, GM->Bounds.Max.Y);
|
||||
SetActorLocation(NewLocation);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void AM4_PlayerPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
||||
@@ -100,7 +98,7 @@ void AM4_PlayerPawn::Shoot(const FInputActionInstance& Inst)
|
||||
FActorSpawnParameters ActorSpawnParams;
|
||||
ActorSpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButDontSpawnIfColliding;
|
||||
|
||||
//World->SpawnActor<AM4_Projectile>(Proj, TargetPosition, SpawnRotation, ActorSpawnParams);
|
||||
Projection = GetWorld()->SpawnActor<AM4_Projectile>(TargetPosition, SpawnRotation, ActorSpawnParams);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,10 @@ protected:
|
||||
UInputAction* ShootAction;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
AM4_Projectile* Proj;
|
||||
AM4_Projectile* Proj;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
TObjectPtr<AM4_Projectile> Projection;
|
||||
|
||||
//bool HasShot = false;
|
||||
float MoveSpeed = 500.f;
|
||||
|
||||
Reference in New Issue
Block a user