
we don 't smooth this so the camera feels like its tightly following the mouse

offset it by the stored amounts, but trace so it stays outside walls Math.Approach(pos.z, targetpos.z, math.abs(targetpos.z - pos.z) * smoothscale) Math.Approach(pos.y, targetpos.y, math.abs(targetpos.y - pos.y) * smoothscale), Math.Approach(pos.x, targetpos.x, math.abs(targetpos.x - pos.x) * smoothscale), smoothing - approaches a bit more slowly to the actual target position Targetpos = targetpos + ply:GetForward() * -5 Targetpos = targetpos + ply:GetForward() * -10 If ply:GetVelocity():DotProduct(ply:GetForward()) > 10 then Local targetpos = Vector(0, 0, ply:OBBMaxs().z) If IsValid(ply) & ply:Alive() & ply:GetNetworkedBool("thirdperson") then Hook.Add("CalcView", "Disguiser.ThirdPersonCalcView", function(ply, pos, angles, fov) * You should have received a copy of the GNU Affero General Public License * GNU Affero General Public License for more details. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * but WITHOUT ANY WARRANTY without even the implied warranty of * This program is distributed in the hope that it will be useful, * License, or (at your option) any later version. * published by the Free Software Foundation, either version 3 of the * it under the terms of the GNU Affero General Public License as * This program is free software: you can redistribute it and/or modify * Copyright (C) 2013 Carl Kittelberger (Icedream) * Not sure if this was where I got the code from, but you can find at * around (read: "optimized") especially for props. * all of this code is done by my hands, it 's rather shortened and moved

* Implements proper third -person view for disguised players. * Disguiser SWEP - Lets you disguise as any prop on a map. Learn more about bidirectional Unicode characters To review, open the file in an editor that reveals hidden Unicode characters. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below.
