• Cam 2d3d Help
    6 replies, posted
I've been trying to mess with Cam 2d3d, and have been entirely unsuccessful. If anyone would offer a helping hand, or a working basic snippet, that i could play around with, i would be most thankful.
How about you post your code instead and we tell you whats wrong with it?
Im currently getting: [code] [ERROR] gamemodes/example/gamemode/cl_init.lua:5: attempt to index global 'Vector' (a function value) 1. v - gamemodes/example/gamemode/cl_init.lua:5 2. unknown - lua/includes/modules/hook.lua:86 [/code] This is my code: [lua] text = "Example 3d2d" function start3d2d() cam.Start3D2D( Vector:ToScreen(), Angle:RotateAroundAxis(), 500 ) draw.DrawText( text, "coolvetica", 2, 2, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER ) cam.End3D2D() end hook.Add( "HUDPaint", "start2d3d01", start3d2d ) [/lua]
It needs 2 vectors in cam.Start3D2D
Uhh.. Are the first 9 lines in your [I]cl_init.lua[/I] seriously the lines you've posted here? No, wait.. ..are you even aware of what the fuck you are doing here? Because it totally doesn't look like it. [lua] text = "Example 3d2d" --why a global variable? function start3d2d() cam.Start3D2D( Vector:ToScreen(), Angle:RotateAroundAxis(), 500 ) --"Vector" and "Angle"? I assume those are no valid variables, aren't they? --Why are you calling ToScreen(), and what is RotateAroundAxis( vec, fl ) supposed to do without the arguments set? draw.DrawText( text, "coolvetica", 2, 2, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER ) cam.End3D2D() end hook.Add( "HUDPaint", "start2d3d01", start3d2d ) [/lua]
This code is never gonna work, there are plenty example around, go read them again.
[QUOTE=RP-01;38227938] [lua] hook.Add( "HUDPaint", "start2d3d01", start3d2d ) --it should be start3d2d(). Don't forget the brackets when calling functions. [/lua][/QUOTE] No it shouldn't. He isn't supposed calling the function.
Sorry, you need to Log In to post a reply to this thread.