## Unity: How to prevent animation from twitching when combined with Navmesh Agent

I am trying to make a third person shooter in Unity and trying to implement a zombie that follows the player and when close to player, attack animation is played. I am using the NavMesh Agent for that purpose. But I am facing the problem that once the zombie comes close and if the player moves back or side ways, the zombie twitches and the transition between the walking and attacking animation appears broken. Also, it slides on the floor around the player. Here is the video of it: Video Here is my code to control the zombie movement:

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI;  public class ZombieController : MonoBehaviour {     public Animator animator;     public NavMeshAgent agent;     public GameObject player;      public float turnSmoothing = 15f;               public float speedDampTime = 0.1f;     private const float stopDistanceProportion = 0.1f;      private int health = 100;      private PlayerContorller pc;      // Start is called before the first frame update     void Start()     {         agent.updateRotation = false;         agent.SetDestination(player.transform.position);         agent.isStopped = true;         pc = player.GetComponent<PlayerContorller>();     }       // Update is called once per frame     void Update()     {         agent.SetDestination(player.transform.position);          if (agent.pathPending)             return;         float speed = 0.0f;         if (!pc.Dead)         {             if (agent.remainingDistance <= agent.stoppingDistance * stopDistanceProportion)             {                 agent.isStopped = true;                 animator.SetBool("PlayerClose", true);                 Quaternion targetRotation = Quaternion.LookRotation(player.transform.position - transform.position);                 transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, turnSmoothing * Time.deltaTime);             }             else if (agent.remainingDistance < 70.0f)             {                 Quaternion targetRotation = Quaternion.LookRotation(player.transform.position - transform.position);                 transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, turnSmoothing * Time.deltaTime);                 float proportionalDistance = 1f - agent.remainingDistance / agent.stoppingDistance;                  speed = Mathf.Lerp(0.5f, 1f, proportionalDistance);                 agent.isStopped = false;                 animator.SetBool("PlayerClose", false);             }             else if (agent.remainingDistance < 100.0f)             {                 Quaternion targetRotation = Quaternion.LookRotation(player.transform.position - transform.position);                 float proportionalDistance = 1f - agent.remainingDistance / agent.stoppingDistance;                 transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, turnSmoothing * Time.deltaTime);                 speed = Mathf.Lerp(0f, 0.5f, proportionalDistance);                 agent.isStopped = false;                 animator.SetBool("PlayerClose", false);             }         }         else         {             agent.isStopped = true;             animator.SetBool("PlayerClose", false);             speed = 0f;         }         animator.SetFloat("Speed", speed);     }      public void Hit()     {         health -= 10;         if(health == 0)         {             animator.Play("Die");             StartCoroutine(Die());          }     }      IEnumerator Die()     {         yield return new WaitForSeconds(10);         Destroy(gameObject);     } } 

The Speed parameter controls Idle (when 0), walking (0-0.5), running(0.5-1) of the zombie, all three are part of a blend tree. And when the PlayerClose parameter is set to true, the animation transitions to the attack animation. How do I fix this? what changes to make in order to fix that?

## What is the AC of a character with 16 dex combined with the spell Armor?

The Spell Armor (Unearthed Arcana p.51-52) states:

The caster creates ,a magical field of force which serves as if it were leather armor (AC 8). If the spell is cast upon a person already armored, it has no effect. However, if it is cast upon a creature with an armor class normally better than 9 (due to its size, speed, skin, etc.) it will benefit the normal armor class by one step, i.e. AC 8 becomes 7, AC 7 becomes 6, and so on. The magic armor spell does not slow or hinder movement, adds no weight or encumbrance, nor does it prevent spell casting(…)

Normally,a character with 16 dex + a leather armor would have AC 6, what bugs me is the ”etc.” in the examples, I believe it is fair to say that my magic-user would have AC 6 since a comparison can be made with the real armor that it imitates, and ”etc.” might be other examples that I’m not aware of, but I don’t think the AC from dexterity is included in those examples.

# In short:

Is my AC 6 or 7?

## Can green flame blade, slashing flourish, and sweeping maneuver be combined for a massive sweeping attack?

A character with the classes: Rogue(Arcane Trickster) lvl 3, Bard (College of Swords) lvl 4, Fighter (Battle Master) lvl 3, has:

2. The Bardic College of Sword’s slashing flourish.
3. Battle Master’s sweeping maneuver.

Can these be used in the same turn against the same 2 foes?

Character is fighting 2 opponents, Casts Green Flame blade and hits target and therefore the “jumping flame” portion of the spell hits the 2nd target as well, and since the attack hit the player decides to use both the flourish and sweep to deal even more damage to the second target.

Do both damage sources stack?

Can both be used at the same time?

Both the slashing flourish and the sweeping maneuver do not require an action nor bonus action to activate. For the attack, would both the flourish and maneuver apply should the player choose to use both resources?

Is it just down to a DM call?

## Is SAT a single language in NP or several languages in NP combined?

I know that a language is in NP if a Turing machine can decide the language of its checking relation $$\{\text{boolean formula }\#\text{ truth assignment | truth assignment is correct}\}$$ in polynomial time.

Here is my confusion. All Turing machine have a finite input alphabet $$\Sigma$$. Thus, none of them can solve any SAT problem with, say, $$|\Sigma|+1$$ variables. Thus, do we need another Turing machine with a larger input alphabet and its associated language to cover this problem? By induction, does this make SAT a union of an infinite number of languages?

If SAT is indeed a union of languages, and any Turing machine only responsible for solving boolean satisfiability problems with variables within its input alphabet, a Turing machine can simply “memorize” all possible 3-SAT problems without redundant clauses over this finite set of variables, and regurgitate the answer in linear time?

In other words, is there a loophole in the definintion of NP that allows for solving SAT by looking up pre-prepared answers? If such cheating is allowed, P=NP?

## Can Lightning Arrow and Conjure Barrage be combined?

The Ranger I DM asked me if he would be able to Cast Lightning Arrow, then use the arrow as ammunition for Conjure Barrage.

Lightning Arrow – Casting Time: 1 bonus action – Duration: Concentration, up to 1 minute

The next time you make a ranged weapon attack during the spell’s duration, the weapon’s ammunition, or the weapon itself if it’s a thrown weapon, transforms into a bolt o f lightning. Make the attack roll as normal. The target takes 4d8 lightning damage on a hit, or half as much damage on a miss, instead o f the weapon’s normal damage. Whether you hit or miss, each creature within 10 feet o f the target must make a Dexterity saving throw. Each o f these creatures takes 2d8 lightning damage on a failed save, or half as much damage on a successful one. The piece o f ammunition or weapon then returns to its normal form. At Higher Levels. When you cast this spell using a spell slot o f 4th level or higher, the damage for both effects o f the spell increases. -PHB 255

Conjure Barrage – Casting Time: 1 action – Duration: Instantaneous

You throw a nonmagical weapon or fire a piece of nonmagical ammunition into the air to create a cone of identical weapons that shoot forward and then disappear. Each creature in a 60-foot cone must succeed on a Dexterity saving throw. A creature takes 3d8 damage on a failed save, or half as much damage on a successful one. The damage type is the same as that of the weapon or ammunition used as a component. -PHB 225

Now on Page 202 it states:

A spell cast with a bonus action is especially swift. You must use a bonus action on your turn to cast the spell, provided that you haven’t already taken a bonus action this turn. You can’t cast another spell during the same turn, except for a cantrip with a casting time of 1 action.

But then on the next page, 203 it also states:

Normal activity, such as moving and attacking, doesn’t interfere with concentration. The following factors can break concentration:

• Casting another spell that requires concentration. You lose concentration on a spell if you cast another spell that requires concentration. You can’t concentrate on two spells at once.

So, would he be able to cast both in the same turn? I interpret the last quote meaning that you can do 2 spells, if 1 is concentration and the other is not, unless a spell doesn’t count as an attack. If he can’t use them in the same round, could he cast Lightning Arrow, save it until the next round, then use it for Conjure Barrage?