Esempio n. 1
0
    public void Seeking(SmartMan EnimeAI)
    {
        Vector3 DesiredVel = EnimeAI.playerTransform.transform.position - EnimeAI.transform.position;

        DesiredVel  = Vector3.Normalize(DesiredVel);
        DesiredVel *= EnimeAI.MaxSpeed;
        Vector3 seekForce = DesiredVel - EnimeAI.rb.velocity;

        EnimeAI.move(seekForce);
    }
Esempio n. 2
0
    public void FleeB(SmartMan EnimeAI)
    {
        Vector3 DesiredVel = EnimeAI.transform.position - EnimeAI.playerTransform.transform.position;

        DesiredVel  = Vector3.Normalize(DesiredVel);
        DesiredVel *= 20f;
        Vector3 FleeForce = DesiredVel - EnimeAI.rb.velocity;

        EnimeAI.move(FleeForce);
    }