Can someone explain what exactly is going on in this code?
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?
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?