UnrealScripterAI
Discord ↗
Link Copied to Clipboard
×
"create an inventory trigger"
AInventoryTrigger::AInventoryTrigger() { // 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; InventorySphere = CreateDefaultSubobject<USphereComponent>(TEXT("Inventory Sphere Component")); InventorySphere->InitSphereRadius(100.0f); InventorySphere->SetCollisionProfileName(TEXT("Trigger")); InventorySphere->SetupAttachment(RootComponent); InventorySphere->OnComponentBeginOverlap.AddDynamic(this, &AInventoryTrigger::OnOverlapBegin); InventorySphere->OnComponentEndOverlap.AddDynamic(this, &AInventoryTrigger::OnOverlapEnd); }