Edit: I got this to work using CalcView and changing the player’s aim in CreateMove.
I am trying to make the player’s view position and angle change without his aim changing.
This would effectively be like a third person view that is completely separate from the player’s position and aim angle.
I would like to keep this completely clientside, although I tried SetViewEntity without getting the results I wanted.
SetViewEntity did not work out because I want the player’s mouse to be input into the camera and syncing that to the server made for an extremely laggy camera.
CalcView seemed viable but then I realized the angle there also affects the player’s aim angle.
The only other way I can see to change the player’s view angle is using the render.RenderView function which works well in the HUDPaint hook.
The problem with the HUDPaint hook is that it draws over previously drawn HUD elements since the render.RenderView function is covering the whole screen.
The render.RenderView function seems to be picky about what hooks it will work in, so try it before recommending a hook.
How can I control the player’s view angle separately from the player’s aim without overwriting previously drawn HUD elements?
I thought that I might be able to use the RenderScene hook to override the drawing of the scene?