First Image show when i enable 15 navmesh agent the fps was 80-90. Agents are simple they just go one point to another point
Second Image show when i disable 15 navmesh agent the fps was 270 to 300. Why?
Please help me out.
Navmesh agent Scrip ----------------
public class AIControl : MonoBehaviour {
GameObject[] goalLocations;
NavMeshAgent agent;
private Animator anim;
private void Awake()
{
anim = GetComponent<Animator>();
goalLocations = GameObject.FindGameObjectsWithTag("goal");
agent = this.GetComponent<NavMeshAgent>();
}
// Use this for initialization
void Start () {
agent.SetDestination(goalLocations[Random.Range(0,goalLocations.Length)].transform.position);
anim.SetFloat("wOffset", Random.Range(0,1));
anim.SetTrigger("isWalking");
}
// Update is called once per frame
void Update () {
if(agent.remainingDistance < 1f)
{
agent.SetDestination(goalLocations[Random.Range(0, goalLocations.Length)].transform.position);
}
}
}