View Single Post
  #8  
Old 01-02-2020, 03:24 PM
Guest001 is offline Guest001
Registered User

Join Date: Aug 2008
Posts: 4,971

Update: Player Scripts

The problem here is to keep the player camera Z height and rotation in the correct orientation relative to the FOV zoom ratio.
Choosing the best camera offset "float" value is difficult to determine at this stage.
So far the camera position and FOV scripts only load once, when the Game World loads.
It'd be far better if the FOVs could load anytime the player picks up a weapon.


Code:
// ZOOM FOR FPS PLAYER UNITS

// Zoom - Mouse Move Adjustment
 if( World.Instance.Simulation && Instance.MouseRelativeMode )

{
 Vec2 OffsetZoomMove = MousePosition				
 if( GetPlayerUnit() != null && GetPlayerUnit() is PlayerCharacter )
 if( GetPlayerCameraType() == PlayerCameraType.FPS )
 OffsetZoomMove /= 3; float value				
 Controls.Instance.DoMoveRelative( OffsetZoomMove );
}


// Zoom - Camera FOV & Zoom Camera Offset
if( Instance.IsEkeysMouseButtonPressed( EkeysMouseButton.Right ) )

{
if( GetPlayerUnit() as PlayerCharacter != null )
if( GetPlayerCameraType() == PlayerCameraType.FPS )
cameraFov /= 6;
cameraOffset /= 3;
}
Reply With Quote