So I'm trying to imitate a limp player in the beginning of my CS.
(will get healthy later, don't worry
)
The problem is that the bodyforce I'm applying is always negative Z (backward force), no matter if the player is walking forwards, backwards or strafing.
void OnStart()
{
SetPlayerRunSpeedMul(0); //Damaged player can't run
SetPlayerMoveSpeedMul(0.8f); //Damaged player moves slow
AddTimer("T1", 0.1f, "BodyForce");
//===========LIMP=========================//
void BodyForce(string &in asTimer)
{
if ( GetPlayerSpeed() > 1 ){
AddPlayerBodyForce(0, 0, -10000, true); //Pushes player backwards, resulting in a slight deceleration.
AddDebugMessage("LIMP!", false);
AddTimer("T3", 1.0f, "BodyForce");
}
else{
AddTimer("T2", 0.1f, "BodyForce");
AddDebugMessage("NO LIMP!", false);
}
}
Is there a way to get information about which direction the player is moving, or has someone else managed to script this effect without going full conversion..?
//AKZEL