// Start is called before the first frame update void Start() { av = transform.parent.GetComponent <Avoidance>(); col = GetComponent <BoxCollider>(); detectRect = gameObject.AddComponent <RectTransform>(); detectRect.sizeDelta = new Vector2(col.size.x, col.size.z); }
void Awake() { rb = gameObject.GetComponent <Rigidbody>(); mechDriver = GetComponent <MechDriver>(); avoid = GetComponent <Avoidance>();; }