Initialize Projectile FrameWork
Ajout des bases (OnHit et Tir) du Projectile. Commencement de la prise en compte des différentes collisions possibles dans le jeu.
This commit is contained in:
35
Source/M4_CPP/private/M4_Projectile.cpp
Normal file
35
Source/M4_CPP/private/M4_Projectile.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "M4_Projectile.h"
|
||||
#include "GameFramework/ProjectileMovementComponent.h"
|
||||
#include "Components/MeshComponent.h"
|
||||
|
||||
// Sets default values
|
||||
AM4_Projectile::AM4_Projectile()
|
||||
{
|
||||
MeshComp = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MeshComp"));
|
||||
MeshComp-> SetRelativeScale3D(FVector(1.f, .1f,.1f));
|
||||
MeshComp->BodyInstance.SetCollisionProfileName(TEXT("Projectile"));
|
||||
MeshComp->OnComponentHit.AddDynamic(this, &AM4_Projectile::OnHit);
|
||||
}
|
||||
|
||||
void AM4_Projectile::OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector Impulse, const FHitResult& Hit)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Called when the game starts or when spawned
|
||||
void AM4_Projectile::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
}
|
||||
|
||||
Called every frame
|
||||
void AM4_Projectile::Tick(float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
}*/
|
||||
|
||||
Reference in New Issue
Block a user