forked from Harrison1/unrealcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyTriggerBox.cpp
More file actions
47 lines (39 loc) · 1.73 KB
/
MyTriggerBox.cpp
File metadata and controls
47 lines (39 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// // Harrison McGuire
// // UE4 Version 4.19.0
// // https://github.com/Harrison1/unrealcpp
// // https://severallevels.io
// // https://harrisonmcguire.com
// // #define print(text) if (GEngine) GEngine->AddOnScreenDebugMessage(-1, 1.5, FColor::Green,text)
// // #define printFString(text, fstring) if (GEngine) GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, FString::Printf(TEXT(text), fstring))
// #include "MyTriggerBox.h"
// // include draw debu helpers header file
// #include "DrawDebugHelpers.h"
// AMyTriggerBox::AMyTriggerBox()
// {
// //Register Events
// OnActorBeginOverlap.AddDynamic(this, &AMyTriggerBox::OnOverlapBegin);
// OnActorEndOverlap.AddDynamic(this, &AMyTriggerBox::OnOverlapEnd);
// }
// // Called when the game starts or when spawned
// void AMyTriggerBox::BeginPlay()
// {
// Super::BeginPlay();
// DrawDebugBox(GetWorld(), GetActorLocation(), GetComponentsBoundingBox().GetExtent(), FColor::Purple, true, -1, 0, 5);
// }
// void AMyTriggerBox::OnOverlapBegin(class AActor* OverlappedActor, class AActor* OtherActor)
// {
// // check if Actors do not equal nullptr and that
// if (OtherActor && (OtherActor != this)) {
// // print to screen using above defined method when actor enters trigger box
// print("Overlap Begin");
// printFString("Overlapped Actor = %s", *OverlappedActor->GetName());
// }
// }
// void AMyTriggerBox::OnOverlapEnd(class AActor* OverlappedActor, class AActor* OtherActor)
// {
// if (OtherActor && (OtherActor != this)) {
// // print to screen using above defined method when actor leaves trigger box
// print("Overlap Ended");
// printFString("%s has left the Trigger Box", *OtherActor->GetName());
// }
// }