using System.Collections; using System.Collections.Generic; using UnityEngine; public class HUDProgress : MonoBehaviour { public GameObject start; public GameObject end; public GameObject progress; private Transform tstart; private Transform tend; // Use this for initialization void Start () { tstart = start.GetComponent(); tend = end.GetComponent(); //progress = new GameObject("Progress"); progress.transform.parent = tstart; progress.transform.localPosition = new Vector3(0, 0, 0); } public void SetProgress(float p) { progress.transform.position = tstart.position * (1 - p) + tend.position * p; Debug.Log("HUDP: ima p" + p ); } }