WEAPON/TranslateFOV

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Now shared)
 
Line 2: Line 2:
 
|Description=Allows to change players field of view while player holds the weapon.
 
|Description=Allows to change players field of view while player holds the weapon.
  
{{Bug|Fixed=|Issue=3564|This doesn't affect the opening of func_areaportals - {{ClassFunction|Player|GetFOV}} takes priority.}}
+
{{Note|This hook must be defined shared and return same value on both to properly affect Area Portals.}}
 
+
{{NextUpdate|The hook is currently clientside-only, but will be shared next update.}}
+
 
|Realm=Shared
 
|Realm=Shared
 
|Predicted=No
 
|Predicted=No

Latest revision as of 16:58, 12 November 2019

 WEAPON:TranslateFOV( )

Contents

Description

Allows to change players field of view while player holds the weapon.

NOTE

This hook must be defined shared and return same value on both to properly affect Area Portals.

Arguments

number fov

The current/default FOV.

Returns

number

The target FOV.

Examples

Example

Reduces players FOV by 30.

function SWEP:TranslateFOV( fov )
	return fov - 30
end

Output:

Players view is zoomed in.
Personal tools
Navigation