stop sliding down slopes - WITH IMAGE

934659--35047--$Screen shot 2012-05-26 at 00.28.13.png

rigidbody on a slope and i want the player to contol its movement up and down a slope so i dont want it to be able to slide. Im using the velocity to move the player so i cant constraint axis.

Also, when it slides down it jitters down, and i think its becoz of this code. Im using this code to angle the player in relation to the slope

        #pragma strict
    
    function OnCollisionEnter(col:Collision)
    {
    	if(col.collider || col.rigidbody)
    	{
    		transform.rotation = col.transform.rotation;
    	}
    }
    
    function OnCollisionStay(col:Collision)
    {
    	if(col.collider || col.rigidbody)
    	{
    		transform.rotation = col.transform.rotation;
    		
    	}
    }
    
    function OnCollisionExit(col:Collision)
    {
    	if(col.collider || col.rigidbody)
    	{
    		transform.rotation = Quaternion.Euler(0,0,0);
    	}
    }

what I have in mind right now for the solution is constraint. Constraint the y position when player is not moving. unConstraint it when player is moving or when you have something drop on the object which is below the player.

no that wont work very efficiently