Right, well this is my code so far. It is located within my playerPawn, mostly because I want those 3D lines to be drawn and I don't know any better way to get hold of the HUD.
Code:
var AU_Flashlight flashlight;
event Tick(float DeltaTime)
{
flashlight = AU_Flashlight(InvManager.FindInventoryType(class'AU_Flashlight'));
Pos = flashlight.Location + (vector(flashlight.Rotation)*300);
hitActor = Trace(HitLocation, HitNormal, Pos, flashlight.Location, FALSE,, hitInfo);
//hitActor = Trace(HitLocation, HitNormal, Pos, Location, FALSE,, hitInfo);
Paint.G=0;
Paint.B=0;
Paint.R=100;
AU_PlayerController(Controller).DrawTraceLine(HitLocation,Pos, Paint);
Paint.G=100;
Paint.B=0;
Paint.R=0;
AU_PlayerController(Controller).DrawTraceLine(flashlight.Location,HitLocation, Paint);
}
I have tested and it does find the right flashlight.
Bookmarks