Lock camera (on) ontriggerenter

I have a problem, when i walk into a trigger area i want my mouselook to be disabled and i’v tried scripts like these:

  function OnTriggerExit(other : Collider)
    {
        GetComponent("MouseLook").enabled = false;
    }

but they wont work! i don’t get errors but it just wont work.

I’m using Unity4 if that’s whats causing it…

First, if you want to disable when entering a trigger, you should probably be using

function OnTriggerEnter(other : Collider)
{
    ...
}

Second, ensure that this trigger script is on the same object that you are expecting to have the MouseLook component. Your code right now is assuming this. If the MouseLook is on the colliding object you would need to do this

function OnTriggerEnter(other : Collider)
{
    var mouseLook = other.GetComponent("MouseLook") as MouseLook;
    if(mouseLook != null) {
        mouseLook.enabled = false;
    }
}