Hello, I am trying to make a derma box show up while the player is looking at an entity.
hook.Add("HUDPaint","DrawInfo",function() local aimPos = LocalPlayer():GetEyeTrace() local playerPos = LocalPlayer():GetPos() local dist = playerPos:Distance(aimPos.Entity:GetPos()) if aimPos.Entity:GetClass() == "paper_blotter" then draw.RoundedBox(5, ScrW()/2-103-2.5, ScrH()/2+15-2.5, 205, 125, Color(255,20,0,255)) end end)
While this works as is, it will not work after I manually set the scale of the model. I am setting the scale using self:SetModelScale(0.3,0) in my ENT:Initialize function. This seems to be conflicting with LocalPlayer():GetEyeTrace().
Anyone have any ideas as to how this could be fixed, or is it a Garry’s Mod bug?