발사체 이동 컴포넌트

This commit is contained in:
강민제 2025-04-29 00:34:53 +09:00
parent b9ab173a18
commit e2751c403c
5 changed files with 14 additions and 6 deletions

Binary file not shown.

Binary file not shown.

BIN
Content/Maps/Main.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -3,6 +3,8 @@
#include "Projectile.h" #include "Projectile.h"
#include "GameFramework/ProjectileMovementComponent.h"
// Sets default values // Sets default values
AProjectile::AProjectile() AProjectile::AProjectile()
{ {
@ -10,6 +12,9 @@ AProjectile::AProjectile()
PrimaryActorTick.bCanEverTick = false; PrimaryActorTick.bCanEverTick = false;
ProjectileMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Projectile Mesh")); ProjectileMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Projectile Mesh"));
RootComponent = ProjectileMesh; RootComponent = ProjectileMesh;
ProjectileMovement = CreateDefaultSubobject<UProjectileMovementComponent>(TEXT("Projectile Movement"));
ProjectileMovement->InitialSpeed = 400.0f;
ProjectileMovement->MaxSpeed = 1000.0f;
} }
// Called when the game starts or when spawned // Called when the game starts or when spawned

View File

@ -28,4 +28,7 @@ private:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess="true")) UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess="true"))
UStaticMeshComponent* ProjectileMesh; UStaticMeshComponent* ProjectileMesh;
// Projectile Movement Component for Shooting
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess="true"))
class UProjectileMovementComponent* ProjectileMovement;
}; };