I’ve been trying to migrate my spring arm and camera components to my APlayerController child class, turning bAutoManageActiveCameraTarget to false and setting the view target to ‘this.’ I’ve overridden OnPossess and added this after Super in order to connect the controller spring arm to the possessed pawn:
GetTransformComponent()->AttachToComponent(Possessed->GetComponentByClass<USkeletalMeshComponent>(), FAttachmentTransformRules::KeepWorldTransform, FName(TEXT("QControllerSocket")));
The component hierarchy is TransformComponent (root) → SpringArmComponent → CameraComponent and I’ve disabled bDoCollisionTest on the spring arm. I’ve also disabled Camera collision on the possessed pawn.
My issue is that even with the spring arm at a target length of 1000, the camera seems to be stuck inside the possessed pawn at the socket where TransformComponent is attached. Been having trouble figuring out why this is the case.
So does APlayerController or AController already have a camera actor or component that is being set as the view target before the one I added? I can’t seem to find it in the source for either parent classes. Is there something I might be missing collision-wise causing the issue? Really at a loss as to what’s going wrong with my implementation.
PS. After drawing a debug sphere at my custom camera components location, I can see that the camera is working fine, I’m simply not using it as a view target for some reason. Is there a function I can use that takes a camera component reference as input and sets it as the view target, as opposed to an AActor?