Since the UT code for locking onto target is very unorganized and complicated (IMO of course) I've decided to simply write my own code from scratch. This will properly lock onto a valid target but it also locks onto anything else like the ground or a wall.
GetAxes(Pawn(Owner).ViewRotation, X, Y, Z);
StartTraceLoc = Location + (512 * X);
EndTraceLoc = Location + (4096 * X);
ExtentVect = vect(128,128,128);
NewTarget = Trace(HitLocation, HitNormal, EndTraceLoc, StartTraceLoc, true, ExtentVect);
Is there any way to tell that that function to only hit pawns of some sort? If not is there another function I could use that would do something similar? The weapon is pretty long range so using a regular trace is out of the question, you would never be able to keep your crosshair on a player model at 7500+ units. Using angles (I think this is how the UT eightball does it) is a less than perfect solution as well because in order to keep the overal radius of the targeting cone small enough at maximum range the angle would have to be extremely small, requiring you to keep your target on the player mesh at medium range instead.
However the extent trace above makes a nice 128 radius cylinder from me to the target meaning that at any range it is possible to lockon without the problem of having to be directly on target at certain ranges. Does anyone know of anything I could do that would only return pawns but act similiar to the "trace cylinder" of the extent trace I used above?
GetAxes(Pawn(Owner).ViewRotation, X, Y, Z);
StartTraceLoc = Location + (512 * X);
EndTraceLoc = Location + (4096 * X);
ExtentVect = vect(128,128,128);
NewTarget = Trace(HitLocation, HitNormal, EndTraceLoc, StartTraceLoc, true, ExtentVect);
Is there any way to tell that that function to only hit pawns of some sort? If not is there another function I could use that would do something similar? The weapon is pretty long range so using a regular trace is out of the question, you would never be able to keep your crosshair on a player model at 7500+ units. Using angles (I think this is how the UT eightball does it) is a less than perfect solution as well because in order to keep the overal radius of the targeting cone small enough at maximum range the angle would have to be extremely small, requiring you to keep your target on the player mesh at medium range instead.
However the extent trace above makes a nice 128 radius cylinder from me to the target meaning that at any range it is possible to lockon without the problem of having to be directly on target at certain ranges. Does anyone know of anything I could do that would only return pawns but act similiar to the "trace cylinder" of the extent trace I used above?