Im sure Im missing something here... I've written a state to make the player climb a wall if its under a certain height. My check for the height of the wall works, but the actual climb doesnt move the player. They just freeze on the spot.
As you can see below, its an extension of player climbing, with the main difference being that I have a check to see if they are over the wall, and a bit of debug to show the new acceleration. When I move forward the debug displays newaccel = 0,0,6000. I also set the pawns physics to Phys_Ladder before I send the pawn to the PlayerWallClimbing state.
But the pawn never moves. Can anyone tell me why ?
As you can see below, its an extension of player climbing, with the main difference being that I have a check to see if they are over the wall, and a bit of debug to show the new acceleration. When I move forward the debug displays newaccel = 0,0,6000. I also set the pawns physics to Phys_Ladder before I send the pawn to the PlayerWallClimbing state.
But the pawn never moves. Can anyone tell me why ?
Code:
// player is climbing a wall
state PlayerWallClimbing extends PlayerClimbing
{
ignores SeePlayer, HearNoise, Bump;
function PlayerMove( float DeltaTime )
{
local vector X,Y,Z, NewAccel, ClimbDir, TraceDir, TraceStart, TraceEnd;
local eDoubleClickDir DoubleClickMove;
local rotator OldRotation, ViewRotation;
local bool bSaveJump;
GetAxes(Rotation,X,Y,Z);
ClimbDir = vect(0,0,1);
NewAccel = aForward*ClimbDir; // do I really want to use aforward?
ClientMessage("newAccel = "$ NewAccel);
if ( VSize(NewAccel) < 1.0 )
NewAccel = vect(0,0,0);
GetAxes(Pawn.Rotation,X,Y,Z);
TraceDir = X;
TraceStart = Location - vect(0,0,-40);
TraceEnd = TraceStart + TraceDir*8.0;
// We need to trace along the feet here
// To see if they've climbed as high as necessary.
if (!FastTrace(TraceStart, TraceEnd))
GotoState('PlayerWalking');
ViewRotation = Rotation;
// Update rotation.
SetRotation(ViewRotation);
OldRotation = Rotation;
UpdateRotation(DeltaTime, 1);
if ( Role < ROLE_Authority ) // then save this move and replicate it
ReplicateMove(DeltaTime, NewAccel, DoubleClickMove, OldRotation - Rotation);
else
ProcessMove(DeltaTime, NewAccel, DoubleClickMove, OldRotation - Rotation);
bPressedJump = bSaveJump;
}
}