Scripting help?

// Patrol.cs
using UnityEngine;
using System.Collections;

public class Patrol : MonoBehaviour {

	public Transform[] points;
	private int destPoint = 0;
	private NavMeshAgent agent;


	void Start () {
		agent = GetComponent<NavMeshAgent>();

		// Disabling auto-braking allows for continuous movement
		// between points (ie, the agent doesn't slow down as it
		// approaches a destination point).
		agent.autoBraking = false;

		GotoNextPoint();
	}


	void GotoNextPoint() {
		// Returns if no points have been set up
		if (points.Length == 0)
			return;

		// Set the agent to go to the currently selected destination.
		agent.destination = points[destPoint].position;

		// Choose the next point in the array as the destination,
		// cycling to the start if necessary.
		destPoint = (destPoint + 1) % points.Length;
	}


	void Update () {
		// Choose the next destination point when the agent gets
		// close to the current one.
		if (agent.remainingDistance < 0.5f)
			GotoNextPoint();
	}
}

I would like to have the character to stop at each point for x seconds then move to the next point and do so again for each point. Is there any way i can do this without coroutines? I am not experienced enough to do coroutines so im trying to see if there is any other way.

It seems there’s been a lot of posts like this where people forgot that the UnityEngine.Time class exists. Not only that, but there’s also System.DateTime, and even System.Diagnostics.StopWatch if you’re despereate. This is not what what Coroutines were meant for, if you need to count things, just use Time.time. It counts the seconds as a float from the moment the scene (or maybe game?) loaded. Regardless, it can be treated like any old float. By setting a time in the future, like Time.time + 5, we can use an if statement to see when Time.time catches up to that number, which will occur the first frame from 5 seconds after that was set.

// Patrol.cs
using UnityEngine;
using System.Collections;
 
 
public class Patrol : MonoBehaviour
{
    public Transform[] points;
    privatefloat waitTime = 0;
    private int destPoint = 0;
    private NavMeshAgent agent;

    void Start ()
    {
        agent = GetComponent<NavMeshAgent> ();
        agent.autoBraking = false;
        GotoNextPoint();
    }

    void GotoNextPoint ()
    {
        waitTime = 0;
        if (points.Length == 0)
            return;
        agent.destination = points[destPoint].position;
        destPoint = (destPoint + 1) % points.Length;
    }

    void Update ()
    {
        if (agent.remainingDistance < 0.5f && waitTime == 0)
            waitTime = Time.time + 5; //seconds goes here
        else if (agent.remainingDistance < 0.5f && Time.time > waitTime)
            GotoNextPoint();
    }
}

Logic is simple. If we’re in range but not timing yet, start timing. Else if were in range and we are past our timer, reset the time and move to new point.

Thank you for the help! I did not forget by the way. Im just new to unity.