Files
M4_CPP/Source/M4_CPP/public/M4_PlayerPawn.h
NisemonoQ 5624625eda 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.
2025-10-19 18:08:05 +02:00

46 lines
987 B
C++

#pragma once
#include "M4_Projectile.h"
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "InputAction.h"
#include "M4_PlayerPawn.generated.h"
class UCameraComponent;
UCLASS()
class AM4_PlayerPawn : public APawn
{
GENERATED_BODY()
public:
AM4_PlayerPawn();
virtual void BeginPlay() override;
virtual void Tick(float DeltaTime) override;
virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
void Move(const FInputActionInstance& Instance);
void Shoot(const FInputActionInstance& Inst);
protected:
UPROPERTY(VisibleAnywhere)
UStaticMeshComponent* MeshComponent;
UPROPERTY()
UInputAction* MoveAction;
UPROPERTY()
UInputAction* ShootAction;
UPROPERTY(VisibleAnywhere)
AM4_Projectile* Proj;
UPROPERTY(VisibleAnywhere)
TObjectPtr<AM4_Projectile> Projection;
//bool HasShot = false;
float MoveSpeed = 500.f;
FVector2D MeshScale = FVector2D(0.6f, 0.5f);
FVector2D LastMoveValue = FVector2D::ZeroVector;
};