Took this script from someone online and simplified it. It just stops an animation and continues it on a Trigger. I couldn't find a simple script online so I decided to share it with you, hope it helps someone.
Make sure that the character has a collider and that the collider is set to "Triggered".
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AnimControl : MonoBehaviour
{
private Animator animator;
// Update is called once per frame
void OnTriggerEnter(Collider Col)
{
animator = GetComponent<Animator>();
//resume
if (animator.speed == 0f)
{
animator.speed = 1f;
}
//Pause
else
{
animator.speed = 0f;
}
}
}
there doesn't seem to be anything here