Created
August 7, 2012 19:30
-
-
Save jquave/3288655 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If player isn't pressing a button and isn't in a jump, slow down, or slide around | |
//if(Mathf.Abs(MacroGetAxis("Horizontal"))<0.1 && !qGrounded) { | |
if(Mathf.Abs(MacroGetAxis("Horizontal"))<0.1 && qGrounded) { | |
// Walking | |
var slideFactor = 1.4; | |
// Sprinting | |
if(Mathf.Abs(currentRunSpeed)>sprintSpeed) slideFactor = 1.1; | |
// Crouching | |
if(MacroGetAxisRaw("Vertical")==-1) slideFactor = 1.018; | |
if(Mathf.Abs(currentRunSpeed)<0.0000001) currentRunSpeed = 0; // Helps with syncing due to float rounding, etc | |
// currentRunSpeed /= slideFactor; | |
try { | |
currentRunSpeed /= slideFactor; | |
} | |
catch (err) { | |
print (err.Message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment