Gamemode.CalcVehicleThirdPersonView

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameCalcVehicleThirdPersonView
SyntaxGM:CalcVehicleThirdPersonView( Vehicle Vehicle, Player player, Vector origin, Angle angles, Number fov )
DescriptionAllows you to change the default camera behaviour when in a vehicle.
ReturnsTable
Lua StateNewerClient.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.CalcVehicleThirdPersonView]Gamemode.CalcVehicleThirdPersonView [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionSets the origin 300 units backwards from the origin.
Used onNewerClient.png
Code
 
function GM:CalcVehicleThirdPersonView(Vehicle, ply, origin, angles, fov)
   local view = {}
   view.angles = angles -- keep the default angle
   view.origin = origin+angles:Forward()*-300 -- get the position 300 units backwards from the origin
   view.fov = fov
   return view
end
 
Output


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox