• World positions of points in corners of player's view
    1 replies, posted
Hello, For a project I'm working on I need to know the world positions of the corners shown in [url=http://i.imgur.com/1SFHsuG.jpg]this image[/url]. How can I get these positions? I'm not very good in local to/from world conversion..
I found the solution. For example when I want the top-left corner: [lua]local tracedata = {} tracedata.start = LocalPlayer():GetShootPos() tracedata.endpos = LocalPlayer():GetShootPos() + gui.ScreenToVector( 0, 0 )*200 tracedata.filter = LocalPlayer() tracedata.mask = MASK_VISIBLE local traceRes = util.TraceLine(tracedata) print( traceRes.HitPos ) print( traceRes.HitWorld )[/lua]
Sorry, you need to Log In to post a reply to this thread.