Get Point Distance ahead

Looked in Legacy:UnrealScript Vector Maths - Unreal Wiki but don’t understand how to apply the solution?

I want to do as it says in the wiki, “find a point that’s at a certain distance from a starting point in a given direction”:



LocationTarget = LocationStart + vector(Rotation) * Distance;

I want to use the end distance vector as the end point for a trace but I don’t understand what I need/how to assign the vector(rotation)? Would it be the rotation of the socket, if so how do I get that?




	pawn.Mesh.GetSocketWorldLocationAndRotation('endTip', TraceStart);

       traceEnd= traceStart + vector(Rotation) * 100; // so I don't understand the vector(rotation) what value and how do I get it ??????

      Foreach TraceActors(class'actor', traced, hitlocation, hitnormal, traceEnd, traceStart, vect(20,20,20))
      {
                etc



Thanks

I used the pawn’s rotation to get the forward rotation of X and adjusted the socket position in the editor to allow for the difference in location.


	pawn.Mesh.GetSocketWorldLocationAndRotation('endTip', TraceStart);
		GetAxes( pawn.Rotation, X, Y, Z );
		traceEnd= traceStart + X * -60;

Even though I have it working it would be nice to understand how to apply the socket’s rotation instead of the pawn’s.

Cheers.

GetSocketWorldLocationAndRotation has a second out param (a Rotator) which gets you the Rotation of the socket :slight_smile:

bah … not sure how I missed that. Cheers.