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);
}
}