Creating a custom camera

  • Problem (That I forgot to say) was fixed… -

CalcView

Yeah, I did look into this but I couldn’t figure out how to use it.

Could you please give me an example?

**[Gamemode.CalcView

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.CalcView)**

The example given on the page is a good one.

Okay guys, I did look into the function for the ‘CLASS’ feature and I applied some code. But now it just remains in the same position as it did before instead of going to my position?

Come someone help me on this? I will post the function.
[lua]
function CLASS:CalcView( pl, pos, ang, fov )
local view={}
view.origin=pl:GetShootPos()+Vector(0,-300,64)
view.angles=Angle(0,-90,0)
view.fov=fov
return view
end
[/lua]

-snip-

Update:
I’ve changed my CalcView to cl_init.lua.

[lua]
include( ‘shared.lua’ )

function GM:PositionScoreboard( ScoreBoard )

ScoreBoard:SetSize( 700, ScrH() - 100 )
ScoreBoard:SetPos( (ScrW() - ScoreBoard:GetWide()) / 2, 50 )

end

function Calcy(ply,origin,angles,fov)
local view={}
view.origin=origin+Vector(0,-300,64)
view.angles=Angle(0,0,0)
view.fov=fov

return view
end
hook.Add(“CalcView”, “MyCalcView”, Calcy)
[/lua]

Note, I still have the same problem.

You’re not telling us what’s wrong.