Advertisement
orfeasel

Overlap Events

Dec 26th, 2015
6,054
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. void ACustomTriggerBox::BeginPlay()
  2. {
  3.     Super::BeginPlay();
  4.  
  5.     //Register the enter and exit overlaps to fire
  6.     OnActorBeginOverlap.AddDynamic(this, &ACustomTriggerBox::OnTriggerEnter);
  7.     OnActorEndOverlap.AddDynamic(this, &ACustomTriggerBox::OnTriggerExit);
  8. }
  9.  
  10. /*PRE 4.12 version*/
  11. void ACustomTriggerBox::OnTriggerEnter(AActor* Other)
  12. {
  13.     GLog->Log("Begin overlap has fired");
  14. }
  15.  
  16. /*PRE 4.12 version*/
  17. void ACustomTriggerBox::OnTriggerExit(AActor* Other)
  18. {
  19.     GLog->Log("End overlap has fired");
  20. }
  21.  
  22. /*4.12 version*/
  23. void ACustomTriggerBox::OnTriggerEnter(AActor* OverlapedActor, AActor* OtherActor)
  24. {
  25.     GLog->Log("Begin overlap has fired");
  26. }
  27.  
  28. /*4.12 version*/
  29. void ACustomTriggerBox::OnTriggerExit(AActor* OverlapedActor, AActor* OtherActor)
  30. {
  31.     GLog->Log("End overlap has fired");
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement