Hi, we recently got a custom idle animation for my military group so it would look cleaner when we were in formations, I thought everything was fine until I noticed after a few seconds the custom idle would break, and the character would look back and forth.
Is it always that specific idle animation that breaks it? Looking into the default animation script it has multiple idles that it plays and it looks like the changing of idle animations overwrites yours.
You could edit or replace this default script either to use your animations or only use one of the default idle animations.
Try to change your animation priority idle to action it should not messed with your custom idle animation.
It what I do with my custom animations to be always on action priority.