x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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 :)

Product Version: UE 4.19
Tags:
more ▼

asked Mar 21 '18 at 11:36 PM in C++ Programming

avatar image

odinn1984
8 1 5

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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 :) 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....

more ▼

answered Mar 22 '18 at 08:12 PM

avatar image

odinn1984
8 1 5

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question