Seems like you mixed up the parameters for Trace. The function head is
Code:
function Actor Trace
(
out vector HitLocation,
out vector HitNormal,
vector TraceEnd,
optional vector TraceStart,
optional bool bTraceActors,
optional vector Extent,
optional out TraceHitInfo HitInfo,
optional int ExtraTraceFlags
);
So your call of the Trace-Function should probably be
Code:
Trace(HitLocation, HitNormal, StartTrace, EndTrace, true, , HitInfo);
I just noticed, that there are some other things messed up as well. I'll copy your code and put comments in those lines that might be incorrect or causing problems.
Code:
exec function Use() {
// This variable never has any value assigned, it will always be none
local Actor TraceHit;
// HitLocation and HitNormal are fine, HitPawn is not needed as seen in the
// Trace call above
local vector HitLocation, HitNormal, HitPawn;
local vector StartTrace, EndTrace;
// First: I'm not even sure if HitInfo is needed in this particular case
// Second: If you're going to use it, the Variable should be of Type
// TraceHitInfo as seen above
local Vector HitInfo;
//Trace from socket locations
Mesh.GetSocketWorldLocationAndRotation(ClimbStartSocketName, StartTrace);
Mesh.GetSocketWorldLocationAndRotation(ClimbEndSocketName, EndTrace);
// This Trace is messed up, see above
// Also: Since you want to use the actor that was hit by this trace, you
// have to assign the result of this function-call to your variable TraceHit
// TraceHit = Trace(HitLocation, HitNormal, StartTrace, ...);
Trace(HitLocation, HitNormal, HitPawn, StartTrace, EndTrace, HitInfo, true);
DrawDebugLine(StartTrace, EndTrace,255,0,255,true);
`log( "Command Trace");
ClientMessage("");
if (TraceHit == none) {
ClientMessage("Nothing found, try again.");
return;
}
if(TraceHit.IsA('StaticMeshActor')) {
GotoState('Climbing');
SetPhysics(PHYS_Flying);
FullBodyAnimSlot.PlayCustomAnim('Climb', 0.5, 0.1, 0.1, FALSE, TRUE);
}
}
Bookmarks