Jump to content
Sign in to follow this  
roguetrooper

drawLine3D as "Predator" target laser?

Recommended Posts

Is there a way to create a custom targetting laser with http://community.bistudio.com/wiki/drawLine3D ?

When you use

onEachFrame {drawLine3D [ASLToATL eyePos player, getPos cursorTarget, [1,0,0,1]];};

the laser is hardly visible from 1st person view and does not target the actual point your weapon is pointing at (points at the center ("getpos") of the object)

Also the following one does not work since the laser always points at the same point.

onEachFrame {drawLine3D [ASLToATL eyePos player, player weaponDirection currentWeapon player, [1,0,0,1]];};

So how can you create a custom targetting laser that behaves like the mounted lasers (acc_pointer_IR) with these properties

* comes out of the weapon (or players 'head')

* points at the point your weapon is pointing at

The visibility on other clients in MP does not play a role. It can be local.

Edited by RogueTrooper

Share this post


Link to post
Share on other sites

The DrawLine3D wiki page shows what the second parameter, should be a Position, but you are passing a Vector3D:

onEachFrame {drawLine3D [ASLToATL eyePos player, player weaponDirection currentWeapon player, [1,0,0,1]];};

You would have to move the start position (1st parameter) X distance (that would represent the laser's maximum range) into the Vector3D direction. Not sure how to do that sorry.

Regarding not being able to see the line on 1st person, I think it's because there's a straight line going out from your player eyes, if you change the Z on the first parameter you should be able to see it. Ideally, you would want this first parameter to be the end of your gun barrel, but I don't know how to get that position.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×