private void FixedUpdate()
    {
        //Updates AI's calculations
        _agent.UpdateForces();

        //Updates Heading as it is needed for AI calculations for next Update frame
        this.Heading = this.Direction.normalized;

        //Updates Location based on AI calculations
        this.transform.position = this.Location;
    }
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        //Updates AI's calculations
        _agent.UpdateForces();
        this.MaxSpeed = 2;
        //Updates Heading as it is needed for AI calculations for next Update frame
        this.Heading = this.Direction.normalized;

        //Updates Location based on AI calculations
        this.transform.position = this.Location;

        //During gameplay will update as player comes into view vs just wandering
        UpdateGhostState();
    }