How to make NPC Routine Movements?

So I am making a topdown 2d game and I want to make NPCs walk around and do some things routinely (like in Skyrim or Stardew Valley) but of course, if we talk to them, they stop. In my game, you can get quests from NPCs so they will have another animation (or what you use) for cinematics. I hope you can help me :slight_smile:

Found a solution! Using AddForce(); works instead of animations.

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

public class ProfessorAnimation : MonoBehaviour
{
   
    public float thrust;
    public Rigidbody2D rb;
    public Animator myAnimator;

    void Start()
    {
       
        Vector3 theScale = transform.localScale;
        thrust = 0.1f;
        rb = GetComponent<Rigidbody2D>();
    }
 void FixedUpdate()
    {
        Vector3 theScale = transform.localScale;
        
        if (Input.GetKeyDown(KeyCode.P)) // Anything you want instead of keydown P
        {
            
            StartCoroutine(Mission1(theScale));
        }
    
       
    }
    
    IEnumerator Mission1(Vector3 theScale)
    {


        
        yield return new WaitForSeconds(1f);
     
        transform.position = new Vector3(30, 10, 0);
        yield return new WaitForSeconds(1f);
        
        
        rb.AddForce(transform.right * thrust);
        yield return new WaitForSeconds(1f);
        rb.AddForce(transform.right * -thrust);
       
        yield return new WaitForSeconds(1f);
      
        theScale.x *= -1;
        transform.localScale = theScale;
        rb.AddForce(transform.right * -thrust);
        yield return new WaitForSeconds(2f);
        rb.AddForce(transform.right * thrust);
      
        yield return new WaitForSeconds(0.5f);
        theScale.x *= -1;
        transform.localScale = theScale;
    }

You can adjust it by changing the thrust value etc.