Add projectile

This commit is contained in:
Emilie Schott 2025-03-12 17:45:00 +01:00
parent 974894bb9f
commit e58d3eb0db
12 changed files with 87 additions and 9 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Legumix/Levels/LVL_GYM_00.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -0,0 +1,33 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "Enemy/DistantEnemy/Projectile/BPProjectile.h"
#include "Components/SphereComponent.h"
// Sets default values
ABPProjectile::ABPProjectile()
{
PrimaryActorTick.bCanEverTick = true;
ProjectileCollision = CreateDefaultSubobject<USphereComponent>(TEXT("ProjectileCollision"));
SetRootComponent(ProjectileCollision);
// Collisions :
ProjectileCollision->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
ProjectileCollision->SetNotifyRigidBodyCollision(true);
ProjectileCollision->BodyInstance.SetCollisionProfileName(TEXT("BlockAllDynamic"));
ProjectileMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("ProjectileMesh"));
ProjectileMesh->SetupAttachment(ProjectileCollision);
}
void ABPProjectile::BeginPlay()
{
Super::BeginPlay();
}
void ABPProjectile::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}

View File

@ -0,0 +1,33 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "BPProjectile.generated.h"
class UStaticMeshComponent;
class USphereComponent;
UCLASS()
class LEGUMEMIX_API ABPProjectile : public AActor
{
GENERATED_BODY()
public:
ABPProjectile();
protected:
virtual void BeginPlay() override;
public:
virtual void Tick(float DeltaTime) override;
private:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
TObjectPtr<USphereComponent> ProjectileCollision;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
TObjectPtr<UStaticMeshComponent> ProjectileMesh;
};