Game won't package, Camera Component Error

Hi there,

I’m trying to get my game to package and can see at the bottom that it’s giving me 490 errors after moving my project from 4.9. The weird thing is that it gives 0 errors at run time or compiling, only when I package. The only error that it shows in is this one:

LogSceneComponent:Error: Component ‘SpringArmComponent /Game/Maps/UEDPIE_0_Traveling_Shark.Traveling_Shark:PersistentLevel.BP_Mercenary_C_0.CameraBoom_TP’ has ‘CameraComponent /Engine/Transient.TRASH_Default__BP_Base_Character_C_0:FollowCamera_TP’ in its AttachChildren array, however, ‘CameraComponent /Engine/Transient.TRASH_Default__BP_Base_Character_C_0:Fo
llowCamera_TP’ believes it is attached to ‘SpringArmComponent /Engine/Transient.TRASH_Default__BP_Base_Character_C_0:CameraBoom_TP’

LogSceneComponent:Error: Component ‘CapsuleComponent /Game/Maps/UEDPIE_0_Traveling_Shark.Traveling_Shark:PersistentLevel.BP_Mercenary_C_0.CollisionCylinder’ has ‘SpringArmComponent /Engine/Transient.TRASH_Default__BP_Base_Character_C_0:CameraBoom_TP’ in its AttachChildren array, however, ‘SpringArmComponent /Engine/Transient.TRASH_Default__BP_Base_Character_
C_0:CameraBoom_TP’ believes it is attached to ‘CapsuleComponent /Engine/Transient.TRASH_Default__BP_Base_Character_C_0:CollisionCylinder’

Does anyone have any idea whats going on here or how I might fix it?

Thanks!

Hey ,

Since you upgraded your project, try deleting your ‘Saved’ and ‘Intermediate’ folders as these maintain references to previous versions of assets and levels. These can sometimes cause corruption within your own project.

Let me know if this resolved your issue, or if you need further assistance.

Cheers,

Hey Andrew,

Thanks for the reply but unfortunately that had no effect on the error :frowning:

Will need some further assistance.

Thanks,

Try right-clicking on your .Uproject file itself, select the ‘Switch Unreal Engine Version…’, and select the correct version you are using. This should re-associate your project’s files to the desired version.

I would also try right-clicking on the ‘Content’ folder within the Content Browser of the editor, and select the ‘Fix up Redirectors in Folder’ option to see if that resolves your issue as well. Let me know if you have further questions or need additional assistance.

Cheers,

Hi Andrew,

Unfortunately this did not fix those errors, and the project will not package still.

Just an update on this, I was able to get the error in the output log now durring gameplay. Happens at begin play or whenever I switch to a new character(all characters are parented off of this same setup).

The camera was created in C++ as well and is inherited in our base character bp and then passed down. Does that give you any ideas for what else it could be?

I just don’t understand what the error message wants me to do to fix it, or what exactly the problem is. Spring arms are supposed to be attached to the capsule component of a character aren’t they?

Could you attempt to recreate or duplicate this blueprint, or even delete and recreate the spring arm attached to the capsule component of the character?

The fact it was created in code could be part of the issue. Do you have any way of reproducing this issue in a simple blueprint based project using the same blueprint set up?

Thank you,

So the only way to edit it seems to be in C++ but I don’t know enough about C++ to know how to fix it. If I comment it out then the engine just crashes as soon as I run.

Here is where it’s getting setup:

CameraBoom_TP = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom_TP"));
CameraBoom_TP->AttachTo(RootComponent);
CameraBoom_TP->TargetArmLength = 212.0f; // The camera follows at this distance behind the character	
CameraBoom_TP->bUsePawnControlRotation = false; // Rotate the arm based on the controller

// Create a follow camera
FollowCamera_TP = CreateDefaultSubobject<UCameraComponent>(TEXT("FollowCamera_TP"));
FollowCamera_TP->AttachTo(CameraBoom_TP, USpringArmComponent::SocketName); // Attach the camera to the end of the boom and let the boom adjust to match the controller orientation
FollowCamera_TP->bUsePawnControlRotation = false; // Camera does not rotate relative to arm
FollowCamera_TP->SetRelativeLocation(FVector(0,37,102));

Looking at the error in the original post, and the code here, is there something thats obviously wrong now?

Hello ,

This line seems like it could be the problem:

FollowCamera_TP->AttachTo(CameraBoom_TP, USpringArmComponent::SocketName);

In this case, is SocketName a variable you have set up that is storing the name of a socket that you have on your CameraBoom_TP? If you’re just referring to the base SocketName variable that is inside of the USpringArmComponent class, this will most likely be returning a null value which could be causing some weird results like what you’re seeing. This isn’t something that the compiler would ever catch however, which would explain why you only get errors when trying to package.

I would suggest creating a FName variable that stores the name of the socket that you plan to attach this Camera to and then pass that into the AttachTo function instead.

Thanks for the reply Matthew! I had a feeling it was somewhere there but I wasn’t sure. Was able to get it to package :slight_smile: