Camera settings not showing in editor

I don’t know why I can’t see the settings of my camera inside the editor, I can see everything else. I am assuming this is why the engine crashes when I try line tracing from it, but it makes no sense it is setup identically to the spring arm which works fine.

The Header where I forward declare class

UPROPERTY(EditAnywhere)
		class USpringArmComponent* PlayerSpringArm;
	UPROPERTY(EditAnywhere)
		class UCameraComponent* PlayerCamera;

Constructor in CPP

	// Create actor components for our classes
	SurvivalStatsComp = CreateDefaultSubobject<USurvivalStatsComponent>("Survival Stats Component");
	PlayerInventory = CreateDefaultSubobject<UPlayerInventory>("Player Inventory");
	
	//Create refrence to our skeletal mesh
	PlayerMesh = GetMesh();
	PlayerMesh->SetupAttachment(GetCapsuleComponent());
	
	//Create and Setup Springarm
	PlayerSpringArm = CreateDefaultSubobject<USpringArmComponent>("Player Spring Arm Camera");
	PlayerSpringArm->TargetArmLength = 0;
	PlayerSpringArm->bUsePawnControlRotation = true;
	PlayerSpringArm->TargetArmLength = 500.f;
	PlayerSpringArm->SetupAttachment(PlayerMesh);
	
	//Create and setup Camera
	PlayerCamera = CreateDefaultSubobject<UCameraComponent>("Player Camera");
	PlayerCamera->SetupAttachment(PlayerSpringArm);
	

Hey @shotty46290,

Are you including "#include “Camera/Component.h” " in your .cpp file? That could be a fix. If not, suggest going to Player-Controlled Cameras | Unreal Engine Documentation and seeing how that camera function works.

I hope this can help you!
-Zen

1 Like

yep, I have the header included, if not it would fail to compile. I went and looked at that documentation, and if you look at my code that is exactly how I have it setup. Aside from having a root scene component that everything derives from (Which I tried and still didn’t work)

Try to change to:

UPROPERTY(VisibleAnywhere)
class USpringArmComponent* PlayerSpringArm;

UPROPERTY(VisibleAnywhere)
class UCameraComponent* PlayerCamera;

nope setting it to visible anywhere didn’t help still has no properties inside the editor.

I’d delete the Binaries and Intermediate folder.
If it still doesn’t work I’d create a new Actor to replace this one.

Deleting the binaries and intermediate folder didn’t work, by replace actor you mean delete the blueprint or the C++ class? Pretty sure I have already tried deleting and re-creating the blueprint but I can try again to be sure.

I got it, deleting the blueprint and re-creating it fixed it, though it would of been nice to know how to fix it without doing that if I had a lot in the blueprint, thankfully all my functionality is inside C++

1 Like