I have the following code:
UCLASS()
class JAMES_API AJAMESBackdropLink : public AActor
{
GENERATED_BODY()
public:
AJAMESBackdropLink();
void OnConstruction( const FTransform& Transform ) override;
UPROPERTY( EditAnywhere, BlueprintReadOnly, Instanced, Category = Backdrop )
AJAMESTrigBoxBackdropChange* PointOne;
UPROPERTY( EditAnywhere, BlueprintReadOnly, Instanced, Category = Backdrop )
AJAMESTrigBoxBackdropChange* PointTwo;
};
AJAMESBackdropLink::AJAMESBackdropLink()
{
}
void AJAMESBackdropLink::OnConstruction( const FTransform& Transform )
{
this->PointOne = new AJAMESTrigBoxBackdropChange();
AttachRootComponentToActor( this->PointOne );
this->PointTwo = new AJAMESTrigBoxBackdropChange();
AttachRootComponentToActor( this->PointTwo );
}
I would like to make a blueprint instance of AJAMESBackdropLink and then have 2 instances of my trigger boxes inside this. I will then drag into my game, a AJAMESBackdropLink blueprint, then pull the trigger points “PointOne” and “PointTwo” to places in the scene, and then this will act as a two way teleport.
But the above code does not work.
What am i doing wrong?