Rigidbody z position will not stay 0

When my rigidbody moves it’s z position will not stay at 0. It should only move on the x and y positions. I have z rotation and z position constraints ticked on the rigidbody? Any ideas?

using UnityEngine;
using System.Collections;

public class MoveAstroids : MonoBehaviour {

	public int astroidSpeed;
	public bool canMoveAst;
	// Use this for initialization
	void Start () 
	{
	
	}
	
	// Update is called once per frame
	void Update () 
	{


		if(transform.position.z >=.1 || transform.position.z <= -.1){
			transform.position = new Vector3(transform.position.x,transform.position.y,0.0f);
		}
		transform.Translate(Vector3.left * Time.deltaTime * astroidSpeed); //move the obj

	
	
	
	
	
	
	}


}

Hi,

Have you tried to put it in “void LateUpdate()” ?

negative ghost rider! Any other ideas?

Is its collider hitting something else maybe? I just put your script on object and work just fine, no z movement at all.