using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class autoZcoordChildren : MonoBehaviour
{

    void Awake()
    {
        foreach (Transform child in transform)
        {
            float _z = 1000 - (-1.0f * (child.position.y)) * 0.01f;
            if (_z < 0.0f)
            {
                _z = 0.0f;
            }
            child.position = new Vector3(child.position.x, child.position.y, _z);

        }
    }
}
