void AExedreCharacter::PreUpdateCamera( float DeltaTime ) { if( !FirstPersonCameraComponent || !EPC || !EMC ) return; //------------------------------------------------------- // Compute rotation for Mesh AIM Offset //------------------------------------------------------- FRotator ControllerRotation = EPC->GetControlRotation(); FRotator NewRotation = ControllerRotation; // Get current controller rotation and process it to match the Character NewRotation.Yaw = CameraProcessYaw( ControllerRotation.Yaw ); NewRotation.Pitch = CameraProcessPitch( ControllerRotation.Pitch + RecoilOffset ); NewRotation.Normalize(); // Clamp new rotation NewRotation.Pitch = FMath::Clamp( NewRotation.Pitch, -90.0f + CameraTreshold, 90.0f - CameraTreshold); NewRotation.Yaw = FMath::Clamp( NewRotation.Yaw, -91.0f, 91.0f); //Update loca variable, will be retrived by AnimBlueprint CameraLocalRotation = NewRotation; }
0.4.18