FPSWalkerEnhanced

Description
This is an enhanced C# port of the original FPSWalker script found in the Unity 2.x Standard Assets. It adds walking and running, sliding down slopes (both those above the Slope Limit and/or specific tagged objects), air control, anti-bunny hopping, the ability to check fall distances, and special anti-bump code that eliminates that irritating "bumpity bumpity bumpa bump" you get when trying to walk down moderately inclined slopes when using the default script.

Original author: Eric Haines (Eric5h5)

Anti Bump Factor
An amount used to reduce or eliminate the "bumping" that can occur when walking down slopes, which is a result of the player constantly toggling between walking and falling small distances. The default of .75 is sufficient for most cases, although a little bit can still occur on steep slopes, assuming sliding isn't enabled. Larger amounts will stop this from ever happening, but too much can result in excessive falling speeds when stepping over an edge. Very small amounts will enable bumping, if that's desired for some reason.

Slide When Over Slope Limit
If checked, the player will slide down slopes that are greater than the Slope Limit as defined by the CharacterController. Attempting to jump up such slopes will also fail. The player has no control until resting on a surface that is under the Slope Limit.

Slide On Tagged Objects
If checked, the player will slide down any objects tagged "Slide" when standing on them, regardless of how much or little they are sloped. (The tag "Slide" must be added to the Tag Manager.) This can be used to create chutes, icy surfaces, etc. Note that tagged objects with zero slope will cause sliding in an undefined direction.

Anti Bunny Hop Factor
Bunny hopping is repeated jumping by virtue of continuously holding down the jump button. Often considered annoying and silly, especially in multiplayer games. If the anti-hop value is at least 1, the player must release the jump button (and the release-and-hold-in-the-air trick is ineffective), and be grounded for the specified number of physics frames before being able to jump again. If the value is 0, then bunny hopping is allowed. If using noticeably large values, implementing some kind of visual indicator of jump availability is recommended to avoid player frustration.

Falling Threshold
How many units the player can fall before triggering the OnFell function. The script as-is merely prints the total number of units that the player fell if this happens but the function can be changed to do anything the programmer desires. The "fallDistance" variable in this function contains the number of vertical units between the initial point of "catching air" and the final impact point. If falling function is irrelevant simply change the number to "Infinity" in the inspector, and the function will never be called.