• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code How to spectate yourself

-=THOR=-

Grizzled Veteran
Sep 20, 2011
1,050
50
Note to myself and the community.

If for whatever reason, you need to spectate your Pawn. In your custom GameInfo class, define this:
Code:
function bool AllowCheats(PlayerController P)
{
    return true;
}

In your custom PlayerController class, define this:
Code:
exec function Camera( name NewMode )
{
    ServerCamera(NewMode);
}

reliable server function ServerCamera( name NewMode )
{
    if ( NewMode == '1st' )
    {
        NewMode = 'FirstPerson';
    }
    else if ( NewMode == '3rd' )
    {
        NewMode = 'ThirdPerson';
    }

    SetCameraMode( NewMode );

    if ( PlayerCamera != None )
        `log("#### " $ PlayerCamera.CameraStyle);
}

When in PIE or in game, use the EnableCheats command.

Then, you can use Insert, Delete, Begin, End, Page Up, Page Down to control the cameras.

Thanks to Yoshiro!
Cheers!

P.S.: Don't forget to remove the code when you're ready for a release!
 
Last edited: