How do I get my character to stop walking after some time?

I have this basic code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class InfinityMove : MonoBehaviour {
    public float speed = 1.1f;

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
        transform.Translate(Vector3.forward * (speed) * Time.deltaTime);

    }
}

But all it does is just move forward, I was wondering how to get it to stop walking after my cutscene animations have stop playing?

Well, if you don’t know about coroutines, I think this is the best moment to start. Coroutines are like an Update function that do it for a set amount of time (arbitrary). They are kinda like time functions.

IEnumerator walk_for_set_time (float _time) {
    float time_elapsed = 0f;

    while (time_elapsed < _time) {
         // Do your walking stuff or call the function that does it
         time_elapsed += Time.deltaTime;
         yield return new WaitForSeconds(Time.deltaTime);
    }
    yield break;
}