From aad21aa4912f2256f780866bdd7032a876b09e4b Mon Sep 17 00:00:00 2001 From: MH261677 Date: Mon, 7 Nov 2022 17:40:38 +0000 Subject: [PATCH] Added Enemycollision script Added enemy collision script and made it output the player being hit. --- Source/the_twilight_abyss/EnemyCollision.cpp | 11 +++++++++++ Source/the_twilight_abyss/EnemyCollision.h | 19 +++++++++++++++++++ the_twilight_abyss.code-workspace | 2 +- the_twilight_abyss.uproject | 5 ++++- 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 Source/the_twilight_abyss/EnemyCollision.cpp create mode 100644 Source/the_twilight_abyss/EnemyCollision.h diff --git a/Source/the_twilight_abyss/EnemyCollision.cpp b/Source/the_twilight_abyss/EnemyCollision.cpp new file mode 100644 index 0000000..d6ce825 --- /dev/null +++ b/Source/the_twilight_abyss/EnemyCollision.cpp @@ -0,0 +1,11 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "EnemyCollision.h" + +void UEnemyCollision::BeginPlay() +{ + Super::BeginPlay(); + + UE_LOG(LogTemp, Display, TEXT("TRIGGER COLLISION BOX SPAWNED IN")); +} \ No newline at end of file diff --git a/Source/the_twilight_abyss/EnemyCollision.h b/Source/the_twilight_abyss/EnemyCollision.h new file mode 100644 index 0000000..97b9357 --- /dev/null +++ b/Source/the_twilight_abyss/EnemyCollision.h @@ -0,0 +1,19 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Components/BoxComponent.h" +#include "EnemyCollision.generated.h" + +/** + * + */ +UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent)) +class THE_TWILIGHT_ABYSS_API UEnemyCollision : public UBoxComponent +{ + GENERATED_BODY() + + protected: + virtual void BeginPlay() override; +}; diff --git a/the_twilight_abyss.code-workspace b/the_twilight_abyss.code-workspace index dfb1376..d2d5a9e 100644 --- a/the_twilight_abyss.code-workspace +++ b/the_twilight_abyss.code-workspace @@ -6,7 +6,7 @@ }, { "name": "UE5", - "path": "A:\\UnrealEngine\\UE_5.0" + "path": "H:\\UE5\\UE_5.0" } ], "settings": { diff --git a/the_twilight_abyss.uproject b/the_twilight_abyss.uproject index ade02f3..2387df4 100644 --- a/the_twilight_abyss.uproject +++ b/the_twilight_abyss.uproject @@ -7,7 +7,10 @@ { "Name": "the_twilight_abyss", "Type": "Runtime", - "LoadingPhase": "Default" + "LoadingPhase": "Default", + "AdditionalDependencies": [ + "Engine" + ] } ], "Plugins": [