Im having an issue where I want my 3D2D text to draw at all times in any area of the map but it doesn't it will disappear when in certain spots of the map or too far away...
here is my ENT:Draw() function
function ENT:Draw()
--self:DrawModel()
self.RenderGroup = RENDERGROUP_BOTH
self:DrawShadow( false )
local ang = LocalPlayer():EyeAngles()
local scale = self:GetPos():Distance(LocalPlayer():GetPos()) / 800
local distance = self:GetPos():Distance(LocalPlayer():GetPos())
ang:RotateAroundAxis( ang:Forward(), 90 )
ang:RotateAroundAxis( ang:Right(), 90 )
self:SetLocationTitle("Example Title")
self:SetLocationSubTitle("Example Sub Title")
cam.Start3D2D(self:GetPos(), ang, scale)
cam.IgnoreZ(true)
draw.SimpleText(self:GetLocationTitle(), "TheDefaultSettings",0,0,Color(255,255,255,255),1,1)
draw.SimpleText(self:GetLocationSubTitle(), "TheDefaultSettings2",0,22,Color(255,255,255,255),1,1)
draw.SimpleText("Distance: ("..distance..")", "TheDefaultSettings2",0,40,Color(255,255,255,255),1,1)
cam.IgnoreZ(false)
cam.End3D2D()
end
That's because the Draw on an entity only works clientside when it is within PVS
I think you can get around this by setting it's state to always transmit
I think that is because entities stop being networked if not in the same PVS as the player, or if simply they are far away. You'd either set it to network all the time (ENTITY/UpdateTransmitState), which I don't recommend, or just send information about this entity from server to client, so it could render it.
when using ENT:UpdateTransmitState() i now can see it when im outside of the skybox and things but it still disappears in some locations
That's weird, Draw() function stops being called for an entity when it's not in players view, or out of the players PVS, so you might have to try another approach with it.
decided to just set the cam3d2d position to the entity and drawing it in PostDrawOpaqueRenderables function instead of the actual entities and that worked
Sorry, you need to Log In to post a reply to this thread.