When i rotate an object (box collider) using a specific button, how can i freeze rotation when it hits another box collider???

When i rotate an object (box collider) using a specific button, how can i freeze rotation when it hits another box collider???

You'll need to use the freeze rotation function inside the onCollisionEnter) function:

//C#    
void OnCollisionEnter(Collision collision)
{
    this.rigidbody.freezeRotation = true; 
}

//Javascript
function OnCollisionEnter(collision : Collision)
{
    rigidbody.freezeRotation = true;
}

You'll want to stick that in the object you want to freeze as the collision object you get back is read only, well that and the object should only set its own variables directly (good practice/style). That won't stop it from moving, but its rotation should stop. You'll need to attach a rigidbody component for that too work.