I have created a APressurePlate class extending the ATriggerVolume.
It compiles just fine, but after placing it in the editor and setting the brush type to “Box”, I see no brush to edit. The green bounding box doesn’t show up, and it broadcasts no overlap events in game.
I placed it next to a native ATriggerVolume instance for comparison:
Header file:
#pragma once
#include "GameFramework/Actor.h"
#include "PressurePlate.generated.h"
UCLASS(BlueprintType, Blueprintable)
class ESCAPE_API APressurePlate : public ATriggerVolume
{
GENERATED_BODY()
public:
APressurePlate();
virtual void BeginPlay() override;
virtual void Tick( float DeltaSeconds ) override;
virtual void NotifyActorBeginOverlap(AActor* OtherActor);
virtual void NotifyActorEndOverlap(AActor* OtherActor);
};
Implementation file:
#include "MyGame.h"
#include "PressurePlate.h"
APressurePlate::APressurePlate()
{
PrimaryActorTick.bCanEverTick = true;
}
void APressurePlate::BeginPlay()
{
Super::BeginPlay();
}
void APressurePlate::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
}
void APressurePlate::NotifyActorBeginOverlap(AActor* OtherActor)
{
UE_LOG(LogTemp, Warning, TEXT("%s entered"), *OtherActor->GetName());
}
void APressurePlate::NotifyActorEndOverlap(AActor* OtherActor)
{
UE_LOG(LogTemp, Warning, TEXT("%s left"), *OtherActor->GetName());
}