[SOLVED]Restricting Y axis doesn't work properly

I have the following code in a script attached to a cube. I want to lock the cube’s y and z and slide it on x. My camera is orthographic and iphone orientation is set to Landscape.

In editor (remote) everything works ok. However, on the device, after compilation, when touched the cube jumps to a different y than what it is originally positioned. Sometimes, if I position the cube to a different transform in the scene it stays properly y-locked after compilation.

I have tried everything I could think of… do you see anything wrong in this code?

var cameraC: Camera; 
var startpos: Vector3;
var startposy: float;
var startposz: float;



function Start(){

cameraC = Camera.main;
screenpos=cameraC.WorldToScreenPoint(gameObject.transform.root.position);
screenposy=startpos.y;
screenposz=startpos.z;
}


function FingerMove (touch: iPhoneTouch) {
	gameObject.transform.root.position = cameraC.ScreenToWorldPoint(new Vector3(touch.position.x, screenposy, screenposz)); 	
}

:?

Camera: Near=0.3, Far=1000, Size=5, View=60
Camera transform = (0,1,-100)
Cube transform = (2, -2, 0)

Problem solved.

For future reference: check to see if child (0,0,0) has been moved away from root object in scene editor.