So I have this code below and I can't make the "DrawModel()" colored. My conclusion is that the prop changes color but the "DrawModel()" doesn't and it overlaps the prop.
[CODE]
test_color = Color(255,255,0,255)
hook.Add("HUDPaint", "test_hudpaint", function()
for k, v in pairs( ents.FindByClass("prop_physics")) do
if LocalPlayer():GetPos():Distance(v:GetPos()) > 100 and LocalPlayer():GetPos():Distance(v:GetPos()) < 2000 then
cam.Start3D()
v:DrawModel()
v:SetMaterial("models/debug/debugwhite")
v:SetRenderMode( 4 )
v:SetColor(test_color)
cam.End3D()
end
end
end)
[/CODE]
Result:
[url]http://imgur.com/a/c6NZF[/url]
[highlight](User was banned for this post ("Wrong forum" - Bengley))[/highlight]
Try placing "v:DrawModel()" after "v:SetColor(test_color)".
I've never worked with cam3D but it's worth a try.
Can't you just use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetColor]Entity:SetColor[/url] on its own without the cam bit or do you need it for an actual HUD for some reason?
[QUOTE=MPan1;52138393]Can't you just use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetColor]Entity:SetColor[/url] on its own without the cam bit or do you need it for an actual HUD for some reason?[/QUOTE]
It's like a scanner so I need the HUD to DrawModel so it can be visible through walls. And it works now just needed to replace the Entity:SetColor with render.SetColorModulation( 1, 1, 0 ). Can someone close this thread?
Sorry, you need to Log In to post a reply to this thread.