3d2d text appear above entity but it is rotating.

Hi all,

Actually I am trying to fix rotating by Player Angle
Any Idea how to stop the rotate



surface.CreateFont( "coolvetica2", {
	font = "Arial", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
	size = 200,
	weight = 600,
	blursize = 1,
	scanlines = 1,
	antialias = true,
	underline = false,
	italic = false,
	strikeout = false,
	symbol = false,
	rotary = false,
	shadow = false,
	additive = true,
	outline = false,
} )
function GM:PostDrawOpaqueRenderables() 
	local text_color = Color(255, 200, 60, 255)
	local offset = Angle(0,90,90)
	for _, ent in pairs(ents.FindByClass("npc_alyx")) do
		cam.Start3D2D(ent:GetPos()+Vector(0,0,90), ent:GetAngles() + LocalPlayer():EyeAngles() + offset, 0.1)
			draw.SimpleText("npc_alyx", "coolvetica2", 0, -120, text_color, TEXT_ALIGN_CENTER, 1) 
			draw.SimpleText(ent:Health().." Health", "coolvetica2", 0, 50, text_color, TEXT_ALIGN_CENTER, 1) 
		cam.End3D2D() 
	end
end


http://imgur.com/eAGe13E

Don’t add angles, use RotateAroundAxis or WorldToLocal functions.

Thanks for all answer I found the way to fix it :smiley: Ty :smiley: RobotBoy655 :smiley: :smiley: :smiley:



function GM:PostDrawOpaqueRenderables() 
	--local trace = LocalPlayer():GetEyeTrace()
	--local angle = trace.HitNormal:Angle()
	--local tr = util.GetPlayerTrace( LocalPlayer() )
	--local trace = util.TraceLine( tr )
	--Angle(0,plyAngles.y,0)
	local ply = LocalPlayer()
	if !IsValid(ply) then return end
	
	local plyPos = ply:GetPos()
	local plyAngles = ply:GetAngles()
	local text_color = Color(255, 200, 60, 255)
	local offset = Angle(0,270,90)
	for _, ent in pairs(ents.FindByClass("npc_alyx")) do
		cam.Start3D2D(ent:GetPos()+Vector(0,0,90),  Angle(0,plyAngles.y,0) + offset, 0.1)
			draw.SimpleText("npc_alyx", "coolvetica2", 0, -120, text_color, TEXT_ALIGN_CENTER, 1) 
			draw.SimpleText(ent:Health().." Health", "coolvetica2", 0, 50, text_color, TEXT_ALIGN_CENTER, 1) 
		cam.End3D2D() 
	end
end


Edited:

http://imgur.com/XSAFQVn

Now I need to find out how can I get the text if the npc in my view similar to trace or aim but I want something bigger because I hate when I need to aim the target to get the class :smiley: and to make the text appear :smiley: