Why am I not seeing AActor in detail after initiating component on editor?

Hi, I’m trying to do a simple thing, adding a property or type AActor* to my Actor (Camera Director) so I can set the camera… Based on the tutorial from Epic Games.

This is the .h file

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "CameraDirector.generated.h"

UCLASS()
class KW_IN_SPACE_API ACameraDirector : public AActor
{
	GENERATED_BODY()
	
public:	
	ACameraDirector();

protected:
  virtual void BeginPlay() override;

public:
  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera")
    AActor* TopDownCamera;
};

And this is the .cpp file:

#include "CameraDirector.h"
#include "Kismet/GameplayStatics.h"

ACameraDirector::ACameraDirector()
{
  PrimaryActorTick.bCanEverTick = false;

  APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 0);
  UE_LOG(LogTemp, Warning, TEXT("This a testing statement. %s"), *PlayerController->GetName());

  PlayerController->SetViewTarget(TopDownCamera);
}

void ACameraDirector::BeginPlay()
{
  Super::BeginPlay();
}

From what I understand this should work and yet I don’t see the option to set TopDownCamera in the details when I drag this to the editor (I see the instance in the world components view).

HELP PLEASE :slight_smile:

So basically the problem was with UE not finding the World… looks like my code not only didn’t work it also caused some engine crashes i’ve been having… lol :slight_smile: live and learn!

I found it out by looking at the logs in saved/crashes and then after i deleted the c++ implementation code and left only the functions (empty) every came back up and now i can choose the camera I want…