// Start is called before the first frame update void Start() { MeshFilter mf = GetComponentInChildren <MeshFilter>(); skin = new Vector2(mf.mesh.bounds.extents.x, mf.mesh.bounds.extents.z); _rb = GetComponent <Rigidbody>(); _gc = FindObjectOfType <GroundConstraints>(); }
// Start is called before the first frame update void Start() { _gc = GetComponent <GroundConstraints>(); combats = FindObjectsOfType <CombatMovement>(); if (combats.Length > 1) { distance = Mathf.Abs(combats[0].transform.position.x - combats[1].transform.position.x); distancePercent = distance / (float)_gc.constrainedArea.x; } if (distancePercent < .3f) { distBetweenChars = Dist.CLOSE; } else if (distancePercent < .7f) { distBetweenChars = Dist.MEDIUM; } else { distBetweenChars = Dist.FAR; } }