Say I have a various of my own classes which are subclasses of various Unreal Engine Classes, like the following:
ASBPlayerCameraManager (subclass of APlayerCameraManager)
ASBPlayerController (subclass of APlayerController)
AFPSCharacter (subclass of ACharacter)
as of now, I have the following constructors for these classes:
ASBPlayerCameraManager:
ASBPlayerCameraManager::ASBPlayerCameraManager(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
//OLD VERSION
/*
ViewPitchMin = -89.9f;
ViewPitchMax = 89.9f;
ViewYawMin = 0.f;
ViewYawMax = 359.999f;
ViewRollMin = -89.9f;
ViewRollMax = 89.9f;
*/
//FREE VERSION
ViewPitchMin = 0.f;
ViewPitchMax = 359.999f;
ViewYawMin = 0.f;
ViewYawMax = 359.999f;
ViewRollMin = 0.f;
ViewRollMax = 359.999f;
}
ASBPlayerController:
ASBPlayerController::ASBPlayerController(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
}
AFPSCharacter:
AFPSCharacter::AFPSCharacter(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP.SetDefaultSubobjectClass<USBCharacterMovementComponent>(AFPSCharacter::CharacterMovementComponentName))
{
FirstPersonCameraComponent = PCIP.CreateDefaultSubobject<UCameraComponent>(this, TEXT("FirstPersonCamera"));
FirstPersonCameraComponent->AttachParent = CapsuleComponent;
FirstPersonCameraComponent->SetRelativeLocation(FVector(0.0f, 0.0f, BaseEyeHeight + 50.0f));
FirstPersonMesh = PCIP.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("FirstPersonMesh"));
FirstPersonMesh->SetOnlyOwnerSee(true);
FirstPersonMesh->AttachParent = FirstPersonCameraComponent;
FirstPersonMesh->bCastDynamicShadow = false;
FirstPersonMesh->CastShadow = false;
Mesh->SetOwnerNoSee(true);
PrimaryActorTick.bCanEverTick = true;
}
How would I go about injecting my own subclasses into each other? I don’t seem to be understanding Unreal’s way of doing this too well yet. Any help would be greatly appreciated!