NestorTejero / ES2016A

VideoJoc Curs Enginyeria Software 2016 - grup A de pràctiques (dijous)
https://nestortejero.github.io/ES2016A/
GNU General Public License v3.0
2 stars 0 forks source link

Improve tower rotation #161

Closed sdiaz7 closed 7 years ago

sdiaz7 commented 7 years ago

Definition of Done

sdiaz7 commented 7 years ago

Try this if you want towers to check if they are facing the target:

private bool IsFacingOther(Transform other)
{       
    if (Vector3.Dot(transform.forward, (other.position - transform.position).normalized) == 1)
    {
        return true;    // Return true if facing target.
    }           
    return false;
}
Nerucius commented 7 years ago

Issue done in parallel with #162.

Pull Request at #180

Nerucius commented 7 years ago

Merged at #180