Rendering an Entity on HUD

Is it possible to Render and Entity on a player’s HUD.

  1. Is it possible?
  2. Is there a standard to doing this?
  3. I don’t want a window, It will pop up for a few seconds and then disappear.

Yeah, you can use a DModelPanel, you can use a ClientsideModel and cam.Start3D2D ( which is similar to DModelPanel, except it sets up a scene ), etc. You can use stencils, and apply other effects. It can look like a window, or it can look like a model just hovering there, or it could be flattened to 2d, etc etc…

Thanks for the reply, I will go look up how to do some of those things.

[editline]11th June 2014[/editline]

Is this correct?

	local ent = GAMEMODE.HintEntity
	local pos = Vector( 30, 0, 10 )
	local model = { ent, pos, Angle:Zero() }
	render.Model( model )

According to the wiki for cam.Start3D2D() I must start 3D first.

This code should work?..

local path = GAMEMODE.HintModel
local angle = Angle( 0, 0, 0 )
local model = { path, Vector(0, 0, 0), angle }
cam.Start3D2D( Vector( 30, 0, 0 ), Angle( 0, 0, 0 ), 1 )
render.Model( model )

but outputs this…

Model missing: error.mdl

Is there any more information that I can supply to maybe get a reply?

Do Entity:Draw() or Entity:DrawModel() inside a 3D camera. Should do the trick.

[editline]11th June 2014[/editline]

“Entity” being your entity variable.

well uhhh… :stuck_out_tongue:

Post cooooodeeee…

Fist off, that was more of a statement, I knew why it did that but I wanted to post that image here.

It did this when the entity was null, sometimes net.ReadEntity returns null but the server isn’t sending a null entitty?

Server print:
Entity [107][prop_physics_multiplayer]

Client print:
[NULL Entity]

Should I be getting the entity client side? and passing the index of the entity in the main Entity Table?

Ended up going with a DFrame and DModelPanel