I want to add a trigger volume to my C++ Actor, that can be set to a sphere/cube/capsule in the editor. This is how I’m currently doing it:
.h
UPROPERTY(EditAnywhere, BlueprintReadOnly, SimpleDisplay)
UShapeComponent* TriggerVolume;
.cpp (Constructor)
Base = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Base"));
TriggerVolume = CreateAbstractDefaultSubobject<UShapeComponent>(TEXT("Trigger Volume"));
RootComponent = Base;
TriggerVolume->AttachParent = Base;
However, I get a crash on the last line of the .cpp file. Is it because the volume is abstract? How can I properly accomplish what I want?
Error:
Access violation - code c0000005 (first/second chance not available)