Why cant i change my ability?

Heres my problem , i want to switch ability when i hit tab, but it does nothing
if i hold tab , its gonna pop all ability

using UnityEngine;
using System.Collections;

public class Ability : MonoBehaviour {
	
	private GUIStyle rocketJumpGUI;
	private GUIStyle sprintGUI;
	private GUIStyle jetpackGUI;
	
	public int rocketJumpCharge;
	public float sprintEnergie;
	public float jetpackFuel;
	
	public bool rocketBool;
	public bool sprintBool;
	public bool jetpackBool;
	
	public int cnt; // switch variable

	// Use this for initialization
	void Start () {
		cnt = 0;
	}
	
	// Update is called once per frame
	void Update () {
		if (cnt == 0)
		rocketJumpAbility();
		if (cnt == 1)
		sprintAbility();
		if (cnt == 2)
		jetpackAbility();
	}
	
	/// <summary>
	/// Rocket Jump Ability
	/// </summary>
		public void rocketJumpAbility(){
		
		if(Input.GetButtonUp("Ability")  cnt == 0)
			{
			Debug.Log("RocketJump Button Pressed");
			if(rocketJumpCharge > 0)
				{
				// ACTION HERE
				rocketJumpCharge--;
				}
			}
		if (Input.GetKey ("tab")  cnt == 0)
			{
			cnt++;
			}
	}
	/// <summary>
	/// Sprint Ability
	/// </summary>	
		public void sprintAbility(){
		
		if(Input.GetButtonUp("Ability")  cnt == 1)
			{
			Debug.Log("Sprint Button Pressed");		
			if(sprintEnergie > 0)    ;
			// ACTION HERE  REMOVE THIS ^
			}
		
		if (Input.GetKey ("tab")  cnt == 1)
			{
			cnt++;
			}
		}
		/// <summary>
		/// Jet Pack Ability
		/// </summary>
		public void jetpackAbility(){
		if(Input.GetButtonUp("Ability")  cnt == 2)
			{
			Debug.Log("jetpack Button Pressed");		
			if(jetpackFuel > 0)    ;
			// ACTION HERE  REMOVE THIS ^
			}
		
		if(Input.GetKey("tab")  cnt == 2)
			{
			cnt = 0;
			}
		}
	
	
	private void displayGUI(){
	
		}
}

I can’t tell from looking, but I’d say the first step is to simplify that code. Why not put the tab test and cnt change in Update only? Also ability button test in update, and then just have the ability methods called when needed? It should make it easier to track down problems and implement fixes.

oh, and I;d use GetKeyUp for the tab test at least until you have it all working. Sometimes GetKey fires way quicker than you think it will.

The problem is that when you hit tab, it IS changing count - but it is cycling through 0, 1, 2 without stopping at any one number.

Here’s how to fix the problem:

using UnityEngine;
using System.Collections;

public class Ability : MonoBehaviour {
	
	private GUIStyle rocketJumpGUI;
	private GUIStyle sprintGUI;
	private GUIStyle jetpackGUI;
	
	public int rocketJumpCharge;
	public float sprintEnergie;
	public float jetpackFuel;
	
	public bool rocketBool;
	public bool sprintBool;
	public bool jetpackBool;
	
	public int cnt; // switch variable

	// Use this for initialization
	void Start () {
		cnt = 0;
	}
	
	// Update is called once per frame
	void Update () {
		checkCnt();
	}
	
	/// <summary>
	/// Rocket Jump Ability
	/// </summary>
		public void rocketJumpAbility(){
		
		if(Input.GetButtonUp("Ability")  cnt == 0)
			{
			Debug.Log("RocketJump Button Pressed");
			if(rocketJumpCharge > 0)
				{
				// ACTION HERE
				rocketJumpCharge--;
				}
			}
			cnt++;
		}
	/// <summary>
	/// Sprint Ability
	/// </summary>	
		public void sprintAbility(){
		
		//if(Input.GetButtonUp("Ability")  cnt == 1)
			//{
			Debug.Log("Sprint Button Pressed");		
			if(sprintEnergie > 0)   {
			// ACTION HERE  REMOVE THIS ^
			}
			//}
			cnt++;
		}
		/// <summary>
		/// Jet Pack Ability
		/// </summary>
		public void jetpackAbility(){
		//if(Input.GetButtonUp("Ability")  cnt == 2)
			//{
			Debug.Log("jetpack Button Pressed");		
			if(jetpackFuel > 0)    {
			// ACTION HERE  REMOVE THIS ^
			}
			//}
			cnt = 0;
		}
		///<summary>
		/// Check what number cnt is
		///<summary>
		public void checkCnt(){
			if (Input.GetKeyUp ("tab")  cnt == 0)
				{
				Debug.Log("0");
				rocketJumpAbility();
				}
			else if(Input.GetKeyUp("tab")  cnt == 1)
				{
				Debug.Log("1");
				sprintAbility();	
				}
			else if(Input.GetKeyUp("tab")  cnt == 2)
				{
				Debug.Log("2");
				jetpackAbility();
				}
			else
				{
				
				}
		}
	
	
	private void displayGUI(){
	
		}
}

Basically, I made sure that I was only checking for tab once each time I pressed it - and I changed the cnt number in the different ability functions. This prevents the Update function from constantly checking and cycling through all the different abilities.