Advertisement
Dieton

BreakActor.cpp

Dec 13th, 2023 (edited)
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.29 KB | Gaming | 0 0
  1. // Fill out your copyright notice in the Description page of Project Settings.
  2.  
  3.  
  4. #include "Breakable/BreakableActor.h"
  5. #include "GeometryCollection/GeometryCollectionComponent.h"
  6. #include "EnhancedInputSubsystems.h"//Debugger stuff
  7.  
  8. ABreakableActor::ABreakableActor()
  9. {
  10.     PrimaryActorTick.bCanEverTick = false;
  11.  
  12.     GeometryCollection = CreateDefaultSubobject<UGeometryCollectionComponent>(TEXT("GeometryCollection"));
  13.     SetRootComponent(GeometryCollection);
  14.     GeometryCollection->SetGenerateOverlapEvents(true);
  15.     GeometryCollection->SetCollisionResponseToChannel(ECollisionChannel::ECC_Camera, ECollisionResponse::ECR_Ignore);
  16.  
  17. }
  18.  
  19. void ABreakableActor::BeginPlay()
  20. {
  21.     Super::BeginPlay();
  22.    
  23. }
  24.  
  25. void ABreakableActor::Tick(float DeltaTime)
  26. {
  27.     //Super::Tick(DeltaTime);
  28.  
  29. }
  30.  
  31. void ABreakableActor::GetHit_Implementation(const FVector& ImpactPoint)
  32. {
  33.     UE_LOG(LogTemp, Warning, TEXT("BreakableActor.cpp: GetHitImplementation"));
  34.     /*
  35.     IHitInterface* HitInterface = Cast<IHitInterface>(BoxHit.GetActor());
  36.     if (HitInterface)
  37.     {
  38.         //HitInterface-      >GetHit(BoxHit.ImpactPoint);
  39.         if (!HitInterface->bIsInCover)
  40.         {
  41.             // Set bIsInCover to true in BP_Breakable After Spawn Treasure and Before Parent GetHit
  42.             HitInterface->Execute_GetHit(BoxHit.GetActor(), BoxHit.ImpactPoint);
  43.         }
  44.     }
  45.     */
  46. }
  47.  
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement