UnrealScripterAI
Discord ↗
Link Copied to Clipboard
×
"create trigger when player interacts with a door"
ADoorTrigger::ADoorTrigger() { // 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; DoorSphere = CreateDefaultSubobject<USphereComponent>(TEXT("Door Sphere Component")); DoorSphere->InitSphereRadius(75.0f); DoorSphere->SetCollisionProfileName(TEXT("Trigger")); DoorSphere->SetupAttachment(RootComponent); DoorSphere->OnComponentBeginOverlap.AddDynamic(this, &ADoorTrigger::OnOverlapBegin); DoorSphere->OnComponentEndOverlap.AddDynamic(this, &ADoorTrigger::OnOverlapEnd); }