Sliding Problem Tomb Raider like game C#

I am making a tomb raider like game. Where the character slides in slopes that are too inclinated. I have a script and have followed the instructions of 3d buzz. But the sliding part doesnt work, I have noticed that if I remove some parts of the code it works, but it slides indefinetly, so maybe what I need is a Raycast that stops the player from sliding when it touches the horizontal plane. Here is the code. I have two scripts that work toghether when attached a character. The TP_Controller2 script wich is not very important, but if you want to test how a character can move go on and attach it to a capsule or character. Somehow this script no longer works in the new unity, but only the sliding part, everything else works fine.

 using UnityEngine;
 using System.Collections;

 public class TP_Controller2 : MonoBehaviour 
 {
public static CharacterController CharacterController;
public static TP_Controller2 Instance;

void Awake() 
{
	CharacterController = GetComponent("CharacterController") as         CharacterController;
	Instance = this;
}

void Update() 
{
	if(Camera.mainCamera == null)
		return;
	
	GetLocomotionInput();
    HandleActionInput();
	
	TP_Motor2.Instance.UpdateMotor();
}

void GetLocomotionInput()
{
	var deadZone = 0.1f;

    TP_Motor2.Instance.VerticalVelocity = TP_Motor2.Instance.MoveVector.y;
	TP_Motor2.Instance.MoveVector = Vector3.zero;
	
	if (Input.GetAxis("Vertical") > deadZone || Input.GetAxis("Vertical") < -deadZone)
		TP_Motor2.Instance.MoveVector += new Vector3(0, 0, Input.GetAxis("Vertical"));
	
	if (Input.GetAxis("Horizontal") > deadZone || Input.GetAxis("Horizontal") < -deadZone)
		TP_Motor2.Instance.MoveVector += new Vector3(Input.GetAxis("Horizontal"), 0, 0);
}

void HandleActionInput()
{

    if (Input.GetKeyDown(KeyCode.Space))
    {
        Jump();
    }

}

public void Jump()
{
    if (!CharacterController.isGrounded)
        return;

    TP_Motor2.Instance.Jump();

}

}

Then there is the TP_Motor2 script, this is important because here it is where the sliding part is. Under void ApplySlide() If you take away this line: slideDirection = Vector3.zero; the character slides, but it slides without stoping. So maybe the solution is that something must be added to recognize the normal of the floor and stop the character from moving. Here is the script.

    using UnityEngine;
    using System.Collections;

public class TP_Motor2 : MonoBehaviour
{
public static TP_Motor2 Instance;

public float MoveSpeed = 10f;
public float JumpSpeed = 16f;
public float Gravity = 31f;
public float TerminalVelocity = 40f;
public float SlideThreshold = 0.6f;
public float MaxControllableSlide = 0.4f;

private Vector3 slideDirection;

public Vector3 MoveVector { get; set; }
public float VerticalVelocity { get; set; }

void Awake() 
{
	Instance = this;
}

public void UpdateMotor() 
{
	ProcessMotion();
}

void ProcessMotion()
{
	// Transform MoveVector to World Space
	MoveVector = transform.TransformDirection(MoveVector);
	
	// Normalize MoveVector if Magnitude > 1
	if (MoveVector.magnitude > 1)
		MoveVector = Vector3.Normalize(MoveVector);

    // Applyslide if applicable
    ApplySlide();

	// Multiply MoveVector by MoveSpeed
	MoveVector *= MoveSpeed;

    // Reapply VerticalVelocity MoveVector.y
    MoveVector = new Vector3(MoveVector.x, VerticalVelocity, MoveVector.z);

    // Apply Gravity
    ApplyGravity();

	// Move Character in World Space
    TP_Controller2.CharacterController.Move(MoveVector * Time.deltaTime);
}

void ApplyGravity()
{
    if (MoveVector.y > -TerminalVelocity)
        MoveVector = new Vector3(MoveVector.x, MoveVector.y - Gravity * Time.deltaTime, MoveVector.z);
    if (TP_Controller2.CharacterController.isGrounded && MoveVector.y < -1)
        MoveVector = new Vector3(MoveVector.x, -1, MoveVector.z);
}

void ApplySlide() // THIS IS THE PART THAT MUST BE CHANGED
{
    if (!TP_Controller2.CharacterController.isGrounded)
        return;

    slideDirection = Vector3.zero;

    RaycastHit hitInfo;
    if (Physics.Raycast(transform.position + Vector3.up, Vector3.down, out hitInfo))
    {
        if (hitInfo.normal.y < SlideThreshold)
            slideDirection = new Vector3(hitInfo.normal.x, -hitInfo.normal.y, hitInfo.normal.z);
    }

    if (slideDirection.magnitude < MaxControllableSlide)
        MoveVector += slideDirection;
    else
    {
        MoveVector = slideDirection;
    }
}

public void Jump()
{
    if (TP_Controller2.CharacterController.isGrounded)
        VerticalVelocity = JumpSpeed;
}

}

@JuanseCoello any progress? Some problem here.