3d2d Help

I am not too bad at lua, but I am just learning 3d2d

[LUA]
hook.Add( “HUDPaint”, “Draw3dTest”, function()

for _,ent in ipairs( ents.GetAll() ) do
	
	if( ent:IsValid() ) then
	
		if( ent:GetClass() == "prop_physics" ) then
		
		cam.Start3D2D( ent:GetPos + Vector( 0,0, 20 ), EyeAngles(), 10 )
			draw.SimpleText( 
				"Test",
				"ScoreboardText",
				0,
				0,
				color_white,
				TEXT_ALIGN_CENTER,
				TEXT_ALIGN_CENTER,				
				1,
				color_white
			)
			
		cam.End3D2D()
	
		end
	end
end

end )
[/LUA]

When This is ran, there are no console errors. If you cannot tell, im trying to get it to say “Test” above all props.

HUDPaint is a 2D drawing hook, so don’t use it for 3D stuff. Use one of the following hooks:

**[Gamemode.PostDrawOpaqueRenderables

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.PostDrawOpaqueRenderables)**
**[Gamemode.PostDrawTranslucentRenderables

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.PostDrawTranslucentRenderables)**

Also, you can shorten your loop code by using **[Ents.FindByClass

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Ents.FindByClass)** instead of ents.GetAll() and your if.

Thanks overv