using System.Collections; using System.Collections.Generic; using UnityEngine; public class trackPosition : MonoBehaviour { private GameObject tracker; private Material grassMat; // Start is called before the first frame update void Start() { grassMat = GetComponent<Renderer>().material; } // Update is called once per frame void Update() { tracker = GameObject.Find("tracker"); Vector3 trackerPos = tracker.GetComponent<Transform>().position; grassMat.SetVector("_trackerPosition", trackerPos); } }