The subject really says it all.
I've been messing with inventory items that change a player's movement, or more accurately, weapons behavior while moving. I want to prevent firing the player's weapon when they are running (basically when their velocity is greater than crouching or walking speed). Right now, I'm calling Pawn(Owner).Weapon.PutDown() on a Tick which checks the player's speed against those previously mentioned values and although it puts the weapon down in the right place, it resets and keeps putting down the weapon instead of keeping it offscreen. How do I put the weapon down and keep it that way until the velocity drops back down?

Code:
function Tick(float dt) { local Pawn P; P = Pawn(Owner); if ( (P == None) || (P.Controller == None) ) { Destroy(); return; } // if we're moving faster than a walk or crouch, whichever is higher if ( (VSize(P.Velocity) > FMax((P.GroundSpeed * (P.WalkingPct * 1.1)),(P.GroundSpeed * (P.CrouchedPct * 1.1)))) && bArmed ) { P.Weapon.PutDown(); P.bNoWeaponFiring = true; bArmed = false; } else if (!bArmed) { P.Weapon.BringUp(); P.bNoWeaponFiring = false; bArmed = true; } }
Comment