73 - Projectile Movement Component
This commit is contained in:
parent
e56044608a
commit
a3cc71b200
Binary file not shown.
|
@ -4,6 +4,7 @@
|
|||
#include "Projectile.h"
|
||||
|
||||
#include "Components/BoxComponent.h"
|
||||
#include "GameFramework/ProjectileMovementComponent.h"
|
||||
|
||||
AProjectile::AProjectile()
|
||||
{
|
||||
|
@ -16,6 +17,9 @@ AProjectile::AProjectile()
|
|||
CollisionBox->SetCollisionResponseToChannels(ECollisionResponse::ECR_Ignore);
|
||||
CollisionBox->SetCollisionResponseToChannel(ECollisionChannel::ECC_Visibility, ECollisionResponse::ECR_Block);
|
||||
CollisionBox->SetCollisionResponseToChannel(ECollisionChannel::ECC_WorldStatic, ECollisionResponse::ECR_Block);
|
||||
|
||||
ProjectileMovementComponent = CreateDefaultSubobject<UProjectileMovementComponent>(TEXT("ProjectileMovementComponent"));
|
||||
ProjectileMovementComponent->bRotationFollowsVelocity = true;
|
||||
}
|
||||
|
||||
void AProjectile::BeginPlay()
|
||||
|
|
|
@ -22,4 +22,7 @@ public:
|
|||
|
||||
UPROPERTY(EditAnywhere)
|
||||
class UBoxComponent* CollisionBox;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
class UProjectileMovementComponent* ProjectileMovementComponent;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue