blaster/Source/Blaster/Weapon/Projectile.cpp

33 lines
908 B
C++
Raw Normal View History

2022-05-04 17:17:25 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#include "Projectile.h"
#include "Components/BoxComponent.h"
AProjectile::AProjectile()
{
PrimaryActorTick.bCanEverTick = true;
CollisionBox = CreateDefaultSubobject<UBoxComponent>(TEXT("CollisionBox"));\
SetRootComponent(CollisionBox);
CollisionBox->SetCollisionObjectType(ECollisionChannel::ECC_WorldDynamic);
CollisionBox->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
CollisionBox->SetCollisionResponseToChannels(ECollisionResponse::ECR_Ignore);
CollisionBox->SetCollisionResponseToChannel(ECollisionChannel::ECC_Visibility, ECollisionResponse::ECR_Block);
CollisionBox->SetCollisionResponseToChannel(ECollisionChannel::ECC_WorldStatic, ECollisionResponse::ECR_Block);
}
void AProjectile::BeginPlay()
{
Super::BeginPlay();
}
void AProjectile::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}