Code: Select all
event PlayerInput( float DeltaTime )
{
[...]
ActivePuppet.ControlMove(DeltaTime, aForward, aStrafe, aUp, bUp, bDown, bLeft, bRight, bPressedJump, rot(0,0,0));
[...]
}
Code: Select all
aBaseY = 300.0 [THIS IS AN AXIS VALUE VIA INPUT]
aForward+=aBaseY;
Spoiler
Code: Select all
function ControlMove(float DeltaTime, float aForward, float aStrafe, float aUp, byte bUp, byte bDown, byte bLeft, byte bRight, bool bPressedJump, rotator DeltaRot)
{
local vector X,Y,Z, OldAccel, NewAccel;
local rotator OldRotation;
local float Speed2D;
local bool bSaveJump;
aForward *= 0.1;
aStrafe *= 0.1;
GetAxes(Rotation,X,Y,Z);
Acceleration = aForward*X + aStrafe*Y + aUp*Z;
if ( bPressedJump ) {DoJump();}
if ( Physics!=PHYS_Spider ) {NewAccel.Z = 0;}
if (Physics == PHYS_Walking) {
Speed2D = Sqrt(Velocity.X * Velocity.X + Velocity.Y * Velocity.Y);
}
// Update rotation.
OldRotation = Rotation;
UpdateRotation(DeltaTime, 0);
if ( bPressedJump ) {
bSaveJump = true;
bPressedJump = false;
}
else {bSaveJump = false;}
bPressedJump = bSaveJump;
MoveSmooth(Acceleration * DeltaTime);
}