We don’t need some fancy methods to call on a grid position for it. It’s a gameObject
. Which has a transform
and thus a transform.position
.
case State.Aiming:
float rotateSpeed = 10f;
Vector3 aimingDirection = (targetUnit.transform.position - transform.position).normalized;
transform.forward = Vector3.Lerp(transform.forward, aimingDirection, Time.deltaTime * rotateSpeed);
break;