The OmniShift Camera System provides a comprehensive, multi-mode camera framework designed for modern game development. It supports 8 distinct camera modes with smooth transitions, intelligent collision handling, and full VR/AR compatibility. The system is built to handle everything from first-person shooters to isometric RPGs, with extensive configuration options for each game type.
| Camera Mode | Description | Use Cases | Performance Impact |
|---|---|---|---|
| First Person Immersive | Full-body view with head-mounted camera | FPS games, VR experiences | Low |
| Third Person Over Shoulder | Classic over-the-shoulder view | Action-adventure, RPG | Low |
| Third Person Follow | Dynamic follow camera with prediction | Racing games, platformers | Medium |
| Side Scroller | 2D sidescrolling with parallax support | 2.5D platformers | Low |
| 2.5D | Fixed/rail camera with limited movement | Linear adventures, puzzle games | Low |
| Isometric | Top-down angled view with rotation | Strategy games, RPGs | Low |
| Top Down | Direct overhead camera | RTS, twin-stick shooters | Low |
| Free Camera | Developer/debug camera with full control | Cinematics, debugging | Minimal |
Description: Head-mounted camera providing full-body visibility with minimal clipping. Perfect for immersive first-person experiences.
Key Features:
Configuration:
FGASPAC_CameraSettings FPSettings;
FPSettings.FieldOfView = 90.0f;
FPSettings.SpringArmLength = 0.0f; // No spring arm
FPSettings.bUsePawnControlRotation = true;
FPSettings.bEnableCameraLag = false;
FPSettings.bEnableCameraCollision = true;
FPSettings.CameraCollisionRadius = 5.0f;
FPSettings.CameraCollisionHeight = 10.0f;
FPSettings.MinViewDistance = 10.0f;
FPSettings.MaxViewDistance = 100.0f;
Use Cases:
Description: Classic third-person camera positioned over the character's shoulder with smooth tracking.
Key Features:
Configuration:
FGASPAC_CameraSettings TPSSettings;
TPSSettings.FieldOfView = 75.0f;
TPSSettings.SpringArmLength = 300.0f;
TPSSettings.SpringArmOffset = FVector(0, 50.0f, 50.0f);
TPSSettings.bEnableCameraLag = true;
TPSSettings.CameraLagSpeed = 5.0f;
TPSSettings.bAllowShoulderSwap = true;
TPSSettings.bRightShoulder = false;
TPSSettings.bEnableCameraCollision = true;
TPSSettings.CameraCollisionRadius = 15.0f;
Description: Dynamic follow camera with predictive tracking and smooth interpolation.
Key Features:
Configuration:
FGASPAC_CameraSettings FollowSettings;
FollowSettings.FieldOfView = 70.0f;
FollowSettings.SpringArmLength = 400.0f;
FollowSettings.bEnableCameraLag = true;
FollowSettings.CameraLagSpeed = 3.0f;
FollowSettings.bEnableCameraCollision = true;
FollowSettings.bUsePawnControlRotation = true;
Description: 2D sidescrolling camera with axis locking for 2.5D games.
Key Features:
Configuration:
FGASPAC_CameraSettings SideScrollerSettings;
SideScrollerSettings.FieldOfView = 60.0f;
SideScrollerSettings.SpringArmLength = 800.0f;
SideScrollerSettings.bLockAxisY = true; // Lock Y-axis
SideScrollerSettings.bLockAxisZ = false;
SideScrollerSettings.bLockAxisX = false;
SideScrollerSettings.bUsePawnControlRotation = false;
SideScrollerSettings.FixedCameraRotation = FRotator(0, 0, 0);
Description: Fixed position camera with limited character movement for hybrid 2D/3D gameplay.
Key Features:
Configuration:
FGASPAC_CameraSettings TwoPointFiveDSettings;
TwoPointFiveDSettings.bLockAxisY = true;
TwoPointFiveDSettings.bLockAxisZ = true;
TwoPointFiveDSettings.FixedCameraLocation = FVector(0, -1000, 300);
TwoPointFiveDSettings.FixedCameraRotation = FRotator(-20, 90, 0);
TwoPointFiveDSettings.bUsePawnControlRotation = false;
Description: Top-down angled camera with rotation support for strategy and RPG games.
Key Features:
Configuration:
FGASPAC_CameraSettings IsometricSettings;
IsometricSettings.FieldOfView = 60.0f;
IsometricSettings.SpringArmLength = 1000.0f;
IsometricSettings.SpringArmOffset = FVector(0, 0, 800);
IsometricSettings.FixedCameraRotation = FRotator(-45, 45, 0);
IsometricSettings.bEnableCameraZoom = true;
IsometricSettings.ZoomSpeed = 5.0f;
IsometricSettings.MinZoomDistance = 500.0f;
IsometricSettings.MaxZoomDistance = 2000.0f;
Description: Direct overhead camera for strategy games and twin-stick shooters.
Key Features:
Configuration:
FGASPAC_CameraSettings TopDownSettings;
TopDownSettings.FieldOfView = 75.0f;
TopDownSettings.SpringArmLength = 1500.0f;
TopDownSettings.SpringArmOffset = FVector(0, 0, 1500);
TopDownSettings.FixedCameraRotation = FRotator(-90, 0, 0);
TopDownSettings.bEnableCameraZoom = true;
TopDownSettings.ZoomSpeed = 8.0f;
Description: Developer/debug camera with full 6DOF movement and rotation control.
Key Features:
Configuration:
FGASPAC_CameraSettings FreeCameraSettings;
FreeCameraSettings.FieldOfView = 90.0f;
FreeCameraSettings.bUsePawnControlRotation = false;
FreeCameraSettings.bEnableCameraZoom = true;
FreeCameraSettings.ZoomSpeed = 10.0f;
FreeCameraSettings.MinZoomDistance = 10.0f;
FreeCameraSettings.MaxZoomDistance = 5000.0f;
// Camera mode control
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetCameraMode(EGASPAC_CameraMode NewMode, float TransitionDuration = 1.0f);
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SwitchCameraMode(EGASPAC_CameraMode NewMode);
UFUNCTION(BlueprintPure, Category = "Camera Manager")
EGASPAC_CameraMode GetCurrentMode() const { return CurrentCameraMode; }
// Camera transitions
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetTransitionDuration(float Duration);
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetEasingFunction(EGASPAC_EasingFunction Easing);
UFUNCTION(BlueprintPure, Category = "Camera Manager")
bool IsTransitioning() const { return bIsTransitioning; }
UFUNCTION(BlueprintPure, Category = "Camera Manager")
float GetTransitionProgress() const;
// Apply camera profile
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void ApplyCameraProfile(UGASPAC_CameraProfileDataAsset* CameraProfile);
// Camera settings
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetCameraSettings(const FGASPAC_CameraSettings& NewSettings);
UFUNCTION(BlueprintPure, Category = "Camera Manager")
const FGASPAC_CameraSettings& GetCurrentSettings() const { return CameraSettings; }
// Field of view
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetFieldOfView(float NewFOV);
UFUNCTION(BlueprintPure, Category = "Camera Manager")
float GetFieldOfView() const;
// Spring arm control
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetSpringArmLength(float Length);
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetSpringArmOffset(const FVector& Offset);
UFUNCTION(BlueprintPure, Category = "Camera Manager")
float GetSpringArmLength() const;
// Shoulder swapping
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SwapShoulder();
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void ToggleShoulder();
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetShoulderSide(bool bRightShoulder);
UFUNCTION(BlueprintPure, Category = "Camera Manager")
bool IsRightShoulder() const { return CameraSettings.bRightShoulder; }
// Zoom control
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void ZoomCamera(float ZoomDelta);
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetCameraDistance(float NewDistance);
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetZoomSpeed(float Speed);
UFUNCTION(BlueprintPure, Category = "Camera Manager")
float GetCurrentZoomDistance() const;
// Free look (for third person modes)
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void StartFreeLook();
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void StopFreeLook();
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void UpdateFreeLook(float Yaw, float Pitch);
UFUNCTION(BlueprintPure, Category = "Camera Manager")
bool IsFreeLooking() const { return CharacterState.bIsFreeLooking; }
// Collision control
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetCameraCollisionEnabled(bool bEnabled);
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetCollisionRadius(float Radius);
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetCollisionHeight(float Height);
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetCollisionChannel(TEnumAsByte<ECollisionChannel> Channel);
// Collision debugging
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void SetDebugCollisionEnabled(bool bEnabled);
UFUNCTION(BlueprintCallable, Category = "Camera Manager")
void UpdateCameraCollision();
USTRUCT(BlueprintType)
struct FGASPAC_CameraSettings
{
// Basic camera properties
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
float FieldOfView = 90.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
float SpringArmLength = 300.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
FVector SpringArmOffset = FVector(0.0f, 50.0f, 0.0f);
// Movement and control
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
bool bUsePawnControlRotation = true;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
bool bEnableCameraLag = false;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
float CameraLagSpeed = 5.0f;
// Collision
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
bool bEnableCameraCollision = true;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
float CameraCollisionRadius = 10.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
float CameraCollisionHeight = 10.0f;
// Shoulder configuration
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
bool bAllowShoulderSwap = true;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
bool bRightShoulder = false;
// Distance constraints
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
float MinViewDistance = 50.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
float MaxViewDistance = 1000.0f;
// Fixed camera for certain modes
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
FRotator FixedCameraRotation = FRotator::ZeroRotator;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
FVector FixedCameraLocation = FVector::ZeroVector;
// Axis locking for 2D modes
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
bool bLockAxisX = false;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
bool bLockAxisY = false;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
bool bLockAxisZ = false;
// Zoom control
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
float ZoomSpeed = 5.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
float MinZoomDistance = 100.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera Settings")
float MaxZoomDistance = 500.0f;
};
// Character class with camera setup
AMyGameCharacter::AMyGameCharacter()
{
// Create camera manager component
CameraManagerComponent = CreateDefaultSubobject<UGASPAC_CameraManagerComponent>(TEXT("CameraManagerComponent"));
// Create camera components
CameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("CameraComponent"));
SpringArmComponent = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArmComponent"));
// Setup spring arm
SpringArmComponent->SetupAttachment(GetCapsuleComponent());
SpringArmComponent->TargetArmLength = 300.0f;
SpringArmComponent->bUsePawnControlRotation = true;
SpringArmComponent->bEnableCameraLag = true;
SpringArmComponent->CameraLagSpeed = 5.0f;
// Setup camera
CameraComponent->SetupAttachment(SpringArmComponent, USpringArmComponent::SocketName);
}
void AMyGameCharacter::BeginPlay()
{
Super::BeginPlay();
// Set initial camera mode
if (CameraManagerComponent)
{
CameraManagerComponent->SetCameraMode(EGASPAC_CameraMode::ThirdPerson_OverShoulder, 2.0f);
}
}
// Camera mode switching with input
void AMyGameCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
// Camera mode switching
PlayerInputComponent->BindAction("ToggleCameraMode", IE_Pressed, this, &AMyGameCharacter::ToggleCameraMode);
PlayerInputComponent->BindAction("SwitchToFirstPerson", IE_Pressed, this, &AMyGameCharacter::SwitchToFirstPerson);
PlayerInputComponent->BindAction("SwitchToThirdPerson", IE_Pressed, this, &AMyGameCharacter::SwitchToThirdPerson);
// Camera controls
PlayerInputComponent->BindAction("ZoomIn", IE_Pressed, this, &AMyGameCharacter::ZoomIn);
PlayerInputComponent->BindAction("ZoomOut", IE_Pressed, this, &AMyGameCharacter::ZoomOut);
PlayerInputComponent->BindAction("SwapShoulder", IE_Pressed, this, &AMyGameCharacter::SwapShoulder);
}
void AMyGameCharacter::ToggleCameraMode()
{
if (!CameraManagerComponent) return;
EGASPAC_CameraMode CurrentMode = CameraManagerComponent->GetCurrentMode();
EGASPAC_CameraMode NextMode;
// Cycle through available modes
switch (CurrentMode)
{
case EGASPAC_CameraMode::FirstPerson_Immersive:
NextMode = EGASPAC_CameraMode::ThirdPerson_OverShoulder;
break;
case EGASPAC_CameraMode::ThirdPerson_OverShoulder:
NextMode = EGASPAC_CameraMode::Isometric;
break;
case EGASPAC_CameraMode::Isometric:
NextMode = EGASPAC_CameraMode::FirstPerson_Immersive;
break;
default:
NextMode = EGASPAC_CameraMode::ThirdPerson_OverShoulder;
break;
}
CameraManagerComponent->SetCameraMode(NextMode, 1.5f);
}
void AMyGameCharacter::SwitchToFirstPerson()
{
if (CameraManagerComponent)
{
CameraManagerComponent->SetCameraMode(EGASPAC_CameraMode::FirstPerson_Immersive, 0.5f);
}
}
void AMyGameCharacter::SwitchToThirdPerson()
{
if (CameraManagerComponent)
{
CameraManagerComponent->SetCameraMode(EGASPAC_CameraMode::ThirdPerson_OverShoulder, 0.5f);
}
}
// Custom camera profile system
UCLASS(BlueprintType)
class OMNISHIFT_API UMyCameraProfile : public UGASPAC_CameraProfileDataAsset
{
GENERATED_BODY()
public:
// Game-specific camera settings
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Game Settings")
TEnumAsByte<EGameType> GameType;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Game Settings")
bool bEnableDynamicFOV = true;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Game Settings")
float DynamicFOVSpeed = 2.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Game Settings")
float SpeedFOVMultiplier = 1.2f;
// Cinematic settings
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cinematic")
bool bEnableCinematicMode = false;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cinematic")
float CinematicFOV = 75.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cinematic")
float CinematicTransitionTime = 2.0f;
// Performance settings
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Performance")
bool bEnablePerformanceMode = false;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Performance")
float PerformanceUpdateFrequency = 30.0f;
};
// Dynamic FOV based on movement speed
void AMyGameCharacter::UpdateCameraFOV(float DeltaTime)
{
if (!CameraManagerComponent || !MyCameraProfile)
{
return;
}
if (!MyCameraProfile->bEnableDynamicFOV)
{
return;
}
// Calculate target FOV based on movement speed
float CurrentSpeed = GetVelocity().Size();
float MaxSpeed = GetCharacterMovement()->GetMaxSpeed();
float SpeedRatio = FMath::Clamp(CurrentSpeed / MaxSpeed, 0.0f, 1.0f);
float TargetFOV = CameraManagerComponent->GetFieldOfView();
if (SpeedRatio > 0.5f)
{
TargetFOV *= MyCameraProfile->SpeedFOVMultiplier;
}
// Smooth FOV transition
float CurrentFOV = CameraManagerComponent->GetFieldOfView();
float NewFOV = FMath::FInterpTo(CurrentFOV, TargetFOV, DeltaTime, MyCameraProfile->DynamicFOVSpeed);
CameraManagerComponent->SetFieldOfView(NewFOV);
}
// Cinematic camera controller
class OMNISHIFT_API UCinematicCameraController : public UActorComponent
{
GENERATED_BODY()
public:
// Cinematic shot definitions
USTRUCT(BlueprintType)
struct FCinematicShot
{
UPROPERTY(EditAnywhere, BlueprintReadWrite)
EGASPAC_CameraMode CameraMode = EGASPAC_CameraMode::FreeCamera;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FVector CameraPosition = FVector::ZeroVector;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FRotator CameraRotation = FRotator::ZeroRotator;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float Duration = 5.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float FieldOfView = 75.0f;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TEnumAsByte<EEasingFunction> EasingType = EEasingFunction::EaseInOut;
};
// Cinematic control
UFUNCTION(BlueprintCallable, Category = "Cinematic")
void StartCinematic(const TArray<FCinematicShot>& Shots);
UFUNCTION(BlueprintCallable, Category = "Cinematic")
void StopCinematic();
UFUNCTION(BlueprintCallable, Category = "Cinematic")
void PauseCinematic();
UFUNCTION(BlueprintCallable, Category = "Cinematic")
void ResumeCinematic();
UFUNCTION(BlueprintPure, Category = "Cinematic")
bool IsCinematicActive() const { return bCinematicActive; }
protected:
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
private:
void ExecuteCurrentShot(float DeltaTime);
void TransitionToNextShot();
UPROPERTY()
TArray<FCinematicShot> CinematicShots;
UPROPERTY()
int32 CurrentShotIndex = 0;
UPROPERTY()
float CurrentShotTime = 0.0f;
UPROPERTY()
bool bCinematicActive = false;
UPROPERTY()
bool bCinematicPaused = false;
};
void UCinematicCameraController::StartCinematic(const TArray<FCinematicShot>& Shots)
{
CinematicShots = Shots;
CurrentShotIndex = 0;
CurrentShotTime = 0.0f;
bCinematicActive = true;
bCinematicPaused = false;
if (CinematicShots.Num() > 0)
{
ExecuteCurrentShot(0.0f);
}
}
// VR-specific camera setup
void AMyVRCharacter::SetupVRCamera()
{
if (!CameraManagerComponent)
{
return;
}
// Enable VR mode
UGameplayStatics::GetPlayerController(this, 0)->SetVirtualRealityMode(true);
// Configure VR camera settings
FGASPAC_CameraSettings VRCameraSettings;
VRCameraSettings.FieldOfView = 110.0f; // Wider FOV for VR
VRCameraSettings.bEnableCameraLag = false; // No lag in VR
VRCameraSettings.bEnableCameraCollision = false; // No collision in VR
VRCameraSettings.bUsePawnControlRotation = true;
CameraManagerComponent->SetCameraSettings(VRCameraSettings);
CameraManagerComponent->SetCameraMode(EGASPAC_CameraMode::FirstPerson_Immersive, 0.1f);
}
// AR camera setup for mixed reality
void AMixedRealityCharacter::SetupARCamera()
{
if (!CameraManagerComponent)
{
return;
}
// Configure AR camera settings
FGASPAC_CameraSettings ARCameraSettings;
ARCameraSettings.FieldOfView = 75.0f;
ARCameraSettings.bEnableCameraLag = false;
ARCameraSettings.bEnableCameraCollision = true;
ARCameraSettings.CameraCollisionRadius = 5.0f;
ARCameraSettings.bUsePawnControlRotation = true;
CameraManagerComponent->SetCameraSettings(ARCameraSettings);
CameraManagerComponent->SetCameraMode(EGASPAC_CameraMode::ThirdPerson_Follow, 0.5f);
}
// Performance-optimized camera configuration
void OptimizeCameraForPerformance(UGASPAC_CameraManagerComponent* CameraComponent)
{
if (!CameraComponent) return;
FGASPAC_CameraSettings OptimizedSettings;
// Reduce update frequency
CameraComponent->SetUpdateFrequency(30.0f); // Down from 60.0f
// Disable expensive features
OptimizedSettings.bEnableCameraLag = false;
OptimizedSettings.bEnableCameraCollision = false;
OptimizedSettings.bAllowShoulderSwap = false;
// Simplified collision
OptimizedSettings.CameraCollisionRadius = 20.0f; // Larger but cheaper
OptimizedSettings.CameraCollisionHeight = 20.0f;
// Reduced detail
OptimizedSettings.MinZoomDistance = 200.0f;
OptimizedSettings.MaxZoomDistance = 400.0f;
CameraComponent->SetCameraSettings(OptimizedSettings);
}
// Dynamic camera quality based on distance
void UpdateCameraQuality(UGASPAC_CameraManagerComponent* CameraComponent, float DistanceToPlayer)
{
if (!CameraComponent) return;
if (DistanceToPlayer < 500.0f)
{
// Full quality
CameraComponent->SetUpdateFrequency(60.0f);
CameraComponent->SetCollisionEnabled(true);
}
else if (DistanceToPlayer < 2000.0f)
{
// Medium quality
CameraComponent->SetUpdateFrequency(30.0f);
CameraComponent->SetCollisionEnabled(true);
}
else
{
// Low quality
CameraComponent->SetUpdateFrequency(15.0f);
CameraComponent->SetCollisionEnabled(false);
}
}
// Enable camera debugging
console: gaspack.DebugCamera 1
// Show camera collision
console: gaspack.ShowCameraCollision 1
// Display camera stats
console: gaspack.ShowCameraStats 1
// Disable debugging
console: gaspack.DebugCamera 0
// Camera debug visualization
class OMNISHIFT_API UCameraDebugComponent : public UActorComponent
{
public:
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
private:
void DrawCameraInfo();
void DrawCameraCollision();
void DrawCameraPath();
};
void UCameraDebugComponent::DrawCameraInfo()
{
UGASPAC_CameraManagerComponent* CameraComponent = GetOwner()->FindComponentByClass<UGASPAC_CameraManagerComponent>();
if (!CameraComponent) return;
// Get camera position and settings
FVector CameraLocation = CameraComponent->GetComponentLocation();
FRotator CameraRotation = CameraComponent->GetComponentRotation();
const FGASPAC_CameraSettings& Settings = CameraComponent->GetCurrentSettings();
// Draw camera frustum
DrawDebugCamera(GetWorld(), CameraLocation, CameraRotation,
Settings.FieldOfView, FColor::Green, false, 0.1f);
// Draw camera info text
FString CameraModeText = FString::Printf(TEXT("Mode: %d, FOV: %.1f"),
(int32)CameraComponent->GetCurrentMode(), Settings.FieldOfView);
GEngine->AddOnScreenDebugMessage(-1, 0.1f, FColor::White, CameraModeText);
}
For complete camera system mastery:
Need help with specific camera requirements? Check the troubleshooting guide or ask for targeted camera solutions.