Vector question...

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

FL-

New Member
Feb 16, 2004
23
0
0
Can someone explain what exactly is going on in this code?

Code:
	ViewPos = PawnOwner.Location + PawnOwner.BaseEyeHeight * vect(0,0,1);
	HitActor = trace(HitLocation,HitNormal,ViewPos+1600*vector(PawnOwner.Controller.Rotation),ViewPos,true);

	NamedPlayer = Pawn(HitActor);

		GetAxes(PlayerOwner.Rotation, X, Y, Z);
		Dir = Normal(NamedPlayer.Location - PawnOwner.Location);

		if (Dir dot X > 0.0)

When will that IF statement be entered? My thought was that it'd be entered if the HitActor was within a 180 degree view of the direction the player is facing and within 1600 unreal units but that doesn't seem to be the case. Am I missing something?
 

FL-

New Member
Feb 16, 2004
23
0
0
What I'm trying to do is make it so that friendly tags show for any friendly you can see (not just on your crosshair, which is what the above code does). Granted a lot of the draw code has been left out, I only pasted the appropriate parts.

Ultimately, what'd I'd like to do is be able to view any friendly tag within 800uu and make you have to focus your weapon (or center of screen) on them at anything above that.
 
Last edited: