So i have a simple car physics in my project but i have been stuck cause my camera keeps disappering when i restart the engine.
When i make a blueprint based of my vehicle code the camera is there until i close my engine and open it again then it has disappeared.
.h file
UPROPERTY(Category = Camera, EditDefaultsOnly, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
class USpringArmComponent* SpringArm;
UPROPERTY(Category = Camera, EditDefaultsOnly, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
class UCameraComponent* Camera;
.cpp file
SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));
SpringArm->SetupAttachment(RootComponent);
SpringArm->TargetArmLength = 500.0f;
SpringArm->bUsePawnControlRotation = true;
Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("ChaseCamera"));
Camera->SetupAttachment(SpringArm, USpringArmComponent::SocketName);
Camera->FieldOfView = 90.0f;
so i would appreciate help cause i cannot make progress on my project cause i am stuck!