I cannot see the settings (including transform) for Spring Arm and Camera in the blueprint editor. In contrast I can see and alter the settings for Sprites and arrowcomponent.
My header file is:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "MyCharacter.generated.h"
UCLASS()
class MAYHEM2D_API AMyCharacter : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
AMyCharacter();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
// Helpful debug in figuring out the direction of a character
UPROPERTY(VisibleAnywhere,BlueprintReadOnly,Category = "Hero")
class UArrowComponent* HeroDirection;
//Character Paper Sprite
UPROPERTY(VisibleAnywhere,BlueprintReadOnly,Category = "Hero")
class UPaperSpriteComponent* HeroSprite;
// Our player's spring arm
UPROPERTY(EditAnywhere,BlueprintReadWrite,Category = "Hero")
class USpringArmComponent* HeroSpringArm;
// Our player's camera
UPROPERTY(EditAnywhere,BlueprintReadWrite,Category = "Hero")
class UCameraComponent* HeroCamera;
};
Components are spawn in cpp as:
if (RootComponent == nullptr)
{
RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("HeroBase"));
}
HeroDirection = CreateDefaultSubobject<UArrowComponent>(TEXT("HeroDirection"));
HeroDirection->SetupAttachment(RootComponent);
HeroSprite = CreateDefaultSubobject<UPaperSpriteComponent>(TEXT("HeroSprite"));
HeroSprite->SetupAttachment(HeroDirection);
HeroSpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("HeroSpringArm"));
HeroSpringArm->SetupAttachment(RootComponent);
HeroCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("HeroCamera"));
HeroCamera->SetupAttachment(HeroSpringArm);
I can change the UPaperSpriteComponent through the Bluepritn editor but not camera or springarm. How is that possible?