Also apply velocity to view entity in third person.

master
Icedream 2014-10-20 11:30:37 +02:00
parent 0d59d285d1
commit 2cf2fbe95a
1 changed files with 2 additions and 1 deletions

View File

@ -316,6 +316,7 @@ function SWEP:EnableThirdPerson(player)
entity:SetModel(player:GetModel()) entity:SetModel(player:GetModel())
entity:Spawn() entity:Spawn()
entity:SetAngles(player:GetAngles()) entity:SetAngles(player:GetAngles())
entity:SetVelocity(player:GetVelocity())
entity:SetMoveType(MOVETYPE_NONE) entity:SetMoveType(MOVETYPE_NONE)
entity:SetParent(player) entity:SetParent(player)
entity:SetOwner(player) entity:SetOwner(player)
@ -323,7 +324,7 @@ function SWEP:EnableThirdPerson(player)
entity:SetRenderMode(RENDERMODE_NONE) entity:SetRenderMode(RENDERMODE_NONE)
entity:SetSolid(SOLID_NONE) entity:SetSolid(SOLID_NONE)
player:SetViewEntity(entity) player:SetViewEntity(entity)
player:SetNetworkedBool("thirdperson", true) player:SetNetworkedBool("thirdperson", true)
end end