Hey all,
I've got a first person death view going on in my gamemode, but if you die a particular way, the camera will clip through the world and you can just see the skybox. I'm looking for a way to stop the camera from going through the world when you're laying on the ground.
Here is a snippet:
hook.Add("CalcView", "nacl_death_view", function(ply, origin, angles, fov)
if ply:Alive() then return end
local rag = ply:GetRagdollEntity()
if !IsValid(rag) then return end
local eyes = rag:GetAttachment(rag:LookupAttachment("eyes"))
local view = {
origin = eyes.Pos,
angles = eyes.Ang,
fov = 90
}
return view
end)
It's because ragdoll entity is created slightly late player's death
Add znear = 1in to the view table, that you are returning.
Sorry, you need to Log In to post a reply to this thread.