UnrealScripterAI
Discord ↗
Link Copied to Clipboard
×
"create an intractable trigger"
AInteractableTrigger::AInteractableTrigger() { // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; InteractionSphere = CreateDefaultSubobject<USphereComponent>(TEXT("Interaction Sphere Component")); InteractionSphere->InitSphereRadius(150.0f); InteractionSphere->SetCollisionProfileName(TEXT("Trigger")); InteractionSphere->SetupAttachment(RootComponent); InteractionSphere->OnComponentBeginOverlap.AddDynamic(this, &AInteractableTrigger::OnOverlapBegin); InteractionSphere->OnComponentEndOverlap.AddDynamic(this, &AInteractableTrigger::OnOverlapEnd); }