• 3D2D Problem!?
    12 replies, posted
Hello, I got this code from the internet. It's the player info display above someones head. I want to redo so it doesn't move with the players angle (3D2D). How would I do this? I tryed allot of options, but mostly it just dissapears. Code: ang:RotateAroundAxis( ang:Forward(), 90 ) ang:RotateAroundAxis( ang:Right(), 90 ) cam.Start3D2D( pos, ang, 0.1 ) draw.SimpleText(trEnt:Nick(), "Text2", 2, - 0.2, nameCol , TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)     cam.End3D2D()
Base it on EyeAngles instead. It'll rotate with your view.
I have now removed it. Seems to work a bit. But now I have the problem that it just stays on a random position? How can I move this? Aswell there is still an "ang" in the 3D2D. It creates errors when I remove this? local ang = LocalPlayer():EyeAngles() local pos = trEnt:EyePos() + Vector(8,10,-10) cam.Start3D2D( pos, ang, 0.1 ) draw.SimpleText(trEnt:Nick(), "Text2", 2, - 0.2, nameCol , TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) cam.End3D2D()
You still need to rotate it when using EyeAngles, try rotating 90 Forward and 90 Right.
It already was on 90 and 90. ang:RotateAroundAxis( ang:Forward(), 90 ) ang:RotateAroundAxis( ang:Right(), 90 )
cam.Start3D2D(pos + Vector(0, 0, 15), Angle(0, ang.y - 90, 90), 0.15) draw.SimpleText(trEnt:Nick(), "Text2", 2, - 0.2, nameCol , TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) cam.End3D2D()
The text is still following me. Somehow I can't find the line that causes this.
Can you elaborate on that?
That solves to problem a bit. It now doesn't move when I move around, but now the text moves whenever the player (That has the text above him) moves. Any fixes for this? Thanks for your time!
-bump-
GM/PostPlayerDraw
I don't really see how this would fix my problem? Which part of the code would stick it to the players back?
"Example 2 Draw a headcrab hat on all players." C'mon man, at least look at the page first.
Sorry, you need to Log In to post a reply to this thread.