발사체 이동 컴포넌트
This commit is contained in:
parent
b9ab173a18
commit
e2751c403c
BIN
Content/Blueprints/Actors/BP_Projectile.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Actors/BP_Projectile.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Pawns/BP_PawnTurret.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Pawns/BP_PawnTurret.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Maps/Main.umap
(Stored with Git LFS)
BIN
Content/Maps/Main.umap
(Stored with Git LFS)
Binary file not shown.
@ -3,6 +3,8 @@
|
||||
|
||||
#include "Projectile.h"
|
||||
|
||||
#include "GameFramework/ProjectileMovementComponent.h"
|
||||
|
||||
// Sets default values
|
||||
AProjectile::AProjectile()
|
||||
{
|
||||
@ -10,6 +12,9 @@ AProjectile::AProjectile()
|
||||
PrimaryActorTick.bCanEverTick = false;
|
||||
ProjectileMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Projectile Mesh"));
|
||||
RootComponent = ProjectileMesh;
|
||||
ProjectileMovement = CreateDefaultSubobject<UProjectileMovementComponent>(TEXT("Projectile Movement"));
|
||||
ProjectileMovement->InitialSpeed = 400.0f;
|
||||
ProjectileMovement->MaxSpeed = 1000.0f;
|
||||
}
|
||||
|
||||
// Called when the game starts or when spawned
|
||||
|
@ -28,4 +28,7 @@ private:
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess="true"))
|
||||
UStaticMeshComponent* ProjectileMesh;
|
||||
|
||||
// Projectile Movement Component for Shooting
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess="true"))
|
||||
class UProjectileMovementComponent* ProjectileMovement;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user