Accelerometer Auto rotate Issue

I have a movement script that works pretty well when I'm playing on Landscape Left, but since I'm building for iPad, it needs to auto-rotate, so I put in a different script to do that, but when I try to make my movement script rotate with it, my objects still move in the opposite direction when playing on Landscape Right. I have my script below, it's probably just an oversight on my part, but I just can't figure it out.

function FixedUpdate()
{
    var dir : Vector3 = Vector3.zero;
    if(DeviceOrientation.LandscapeLeft)
    {
        dir.x = -Input.acceleration.y*.5;
        transform.position.x += dir.x;
    }
    else if(DeviceOrientation.LandscapeRight)
    {
        dir.x = Input.acceleration.y*.5;
        transform.position.x += dir.x;
    }
}

Is there a chance that when you flip the device Input.acceleration gives you negative values, and you just cancel them out when you negate them because you expect to receive positive ones?... Try and show the acceleration values on a GuiText on the screen to debug it better.

I'm afraid it was a long time ago I fiddled with iDevices and Unity and I'm a bit rusty.

See, this is what I mean I'm rusty... Can't believe I missed it.

You're not checking the current orientation in your IF clause... DeviceOrientation.LandscapeLeft is an enum. It's like a constant value that you check against something. In your case: Input.deviceOrientation

:)

if you print out the value of DeviceOrientation.PortraitUpsideDown, for example, you will always get the same value, and it will never change. The important thing is which of these values is in Input.deviceOrientation at the moment, and it can only be one of the values in that enumeration. Check the example in the link if it's confusing.