Trying to get 3D2D to work

I’ve been trying for the best part of an hour now to get a simple example of 3D2D working. This is my code being run on the client side:

function drawTest()
cam.Start3D2D( Vector(0, 0, 30), Angle(0, 0, 0), 2 )
draw.DrawText(“Testing”, “ScoreboardText”, 0, 0, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER )

hook.Add( “RenderScreenspaceEffects”, “Test3D2D”, drawTest );

I also tried to hook using HUDPaint. From my understand this should create text at the origin 30 units high. What am I doing wrong?

Is anybody that has used this before able to help??

function DrawName( ply )

if !ply:Alive() then return end

local offset = Vector( 0, 0, 85 )
local ang = LocalPlayer():EyeAngles()
local pos = ply:GetPos() + offset + ang:Up()

ang:RotateAroundAxis( ang:Forward(), 90 )
ang:RotateAroundAxis( ang:Right(), 90 )

surface.CreateFont ( "coolvetica", 40, 400, true, false, "CV20", true )

cam.Start3D2D( pos, Angle( 0, ang.y, 90 ), 0.25 )
	draw.DrawText( ply:GetName(), "CV20", 2, 2, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER )

hook.Add( “PostPlayerDraw”, “DrawName”, DrawName )

Example from Wiki.

The function I am using is the other example from the wiki. The only thing altered is the text and I added 30 units to the z value of the pos vector.

Your angles probably had it facing downwards or in an angle you couldn’t see.

I’m guessing you tested this on construct - I’ve been mucking about with that today, and Angle(0,0,0) makes it point upwards, only visible from above. Try Angle(90,0,0) or something.

Nope flatgrass, but I tested it on construct too after I read your post…no idea why. I changed the angles noclipped around it. Even spawned a 3d grid to make sure I was looking at the exact place the text was meant to be…nothing!

Grasping at straws here, and I know this shouldn’t make any difference but I am testing it in singleplayer sandbox if that changes anything.

Add a print command to it, to make sure it’s actually being run.

Use print to debug your stuff in future.

Yep I do ofcourse. Not for very long though as it spams my console with messages. I did manage to get it working but I’m not sure how or why it works now and not before. I hooked it to PostDrawOpaqueRenderables after reading another similiar post about 3D2D not working.