My XP System Refuses To Work... Help Please

Hey Guys
i need some help
for some reason my experience system wont work, as far as i can remember this is the same way i had my code set out in a previous project(cant find this project, hence the need to recode)
its not adding the xp and levels when i collide with the “XPOrbs” and its not destroying the xporb on contact
when i just had the system set so that if i hit “Space” then i would gain XP and that worked perfectly but now nothing happens
any help would be greatly appreciated

using UnityEngine;
using System.Collections;

public class XPSystem : MonoBehaviour
{
public float minXp;
public float xpNeeded;
public float currentXp;
public float currentLevel;

void Awake () {

}
void OnCollisionEnter(Collider collider)
{
	switch (collider.gameObject.tag) 
	{
	case "XPOrb":
		

	Destroy (this.gameObject);
		
	break;
		
	}

}
void Update () {

	if (collider.gameObject.tag == "XPOrb") 
	{
		currentXp += 10f;
	}

	if (currentXp < minXp)
		currentXp = minXp;

	if (currentXp >= xpNeeded) 
	{
		LevelUp();
	}
}
void LevelUp() {
	currentLevel ++;
	currentXp = 0f;
	xpNeeded += 100f;
}

}

Everything inside your update loop should go into your switch case inside OnCollisionEnter. Since you are trying to check inside Update loop if the tag of the collided game object is XPOrb which will always be false since inside update there is no collision object to check against for your Update loop. Your that collision object from Update actually trying to reference the collision object passed as argument to your OnCollisionEnter, which you can not perform from Update.

void OnCollisionEnter(collision collision)
{
    switch (collision.gameObject.tag) 
    {
    case "XPOrb":
 
    currentXp += 10f;
 
    if (currentXp < minXp)
        currentXp = minXp;
 
    if (currentXp >= xpNeeded) 
    {
        LevelUp();
    }
 
    Destroy (this.gameObject);
 
    break;
 
    }
 
}