I have an actor that has:
- 2 UCameraComponents attached to it.
- 2 UBoxComponents attached to it.
The actor is a teleportation device. The 2 camera components registered to it are meant to be markers as to where i should move my main camera, the ■■■ components are where i am going to move my player.
I used CameraComponents rather than targets so i could use the camera viewing feature in unreal engine to get the right position set up for the camera.
The issue seems that only the first UCameraComponent can be looked through. The other cannot be previewed.
Is this a bug or am i doing something wrong:
class ECDD_API ABackdropLink : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
ABackdropLink();
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
UPROPERTY( VisibleAnywhere, BlueprintReadWrite, Category = Backdrop )
USceneComponent* dummyRoot;
UPROPERTY( VisibleAnywhere, BlueprintReadWrite, Category = Backdrop )
USceneComponent* pointA;
UPROPERTY( VisibleAnywhere, BlueprintReadWrite, Category = Backdrop )
UBackdropLinkCameraMarker* cameraPointA;
UPROPERTY( VisibleAnywhere, BlueprintReadWrite, Category = Backdrop )
UBackdropLinkTrigger* triggerPointA;
UPROPERTY( VisibleAnywhere, BlueprintReadWrite, Category = Backdrop )
UBackdropLinkTrigger* targetPointA;
UPROPERTY( VisibleAnywhere, BlueprintReadWrite, Category = Backdrop )
USceneComponent* pointB;
UPROPERTY( VisibleAnywhere, BlueprintReadWrite, Category = Backdrop )
UBackdropLinkCameraMarker* cameraPointB;
UPROPERTY( VisibleAnywhere, BlueprintReadWrite, Category = Backdrop )
UBackdropLinkTrigger* triggerPointB;
UPROPERTY( VisibleAnywhere, BlueprintReadWrite, Category = Backdrop )
UBackdropLinkTrigger* targetPointB;
void IsOverlappingTarget(UBackdropLinkTrigger* target, UBoxComponent* targetPoint, UBackdropLinkCameraMarker* cameraPoint);
};
ABackdropLink::ABackdropLink()
{
// 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;
this->dummyRoot = CreateDefaultSubobject<USceneComponent>( TEXT( "Dummy Root" ) );
this->dummyRoot->AttachTo( this->RootComponent );
this->pointA = CreateDefaultSubobject<USceneComponent>( TEXT( "Point A" ) );
this->pointA->SetVisibility( true );
this->triggerPointA = CreateDefaultSubobject<UBackdropLinkTrigger>( TEXT( "Trigger Point A" ) );
this->targetPointA = CreateDefaultSubobject<UBackdropLinkTrigger>( TEXT( "Target Point A" ) );
this->cameraPointA = CreateDefaultSubobject<UBackdropLinkCameraMarker>( TEXT( "Camera Point A" ) );
this->pointA->AttachTo( this->dummyRoot );
this->triggerPointA->AttachTo( this->pointA );
this->targetPointA->AttachTo( this->pointA );
this->cameraPointA->AttachTo( this->pointA );
this->pointB = CreateDefaultSubobject<USceneComponent>( TEXT( "Point B" ) );
this->pointB->SetVisibility( true );
this->triggerPointB = CreateDefaultSubobject<UBackdropLinkTrigger>( TEXT( "Trigger Point B" ) );
this->targetPointB = CreateDefaultSubobject<UBackdropLinkTrigger>( TEXT( "Target Point B" ) );
this->cameraPointB = CreateDefaultSubobject<UBackdropLinkCameraMarker>( TEXT( "Camera Point B" ) );
this->pointB->AttachTo( this->dummyRoot );
this->triggerPointB->AttachTo( this->pointB );
this->targetPointB->AttachTo( this->pointB );
this->cameraPointB->AttachTo( this->pointB );
}