Managing animation bones through a script

Hello developers!

There was a problem with animating the enemy. I need the enemy to look at the player clearly, not turning his body completely, but only his back. How can this be implemented through a script?

Probably the easiest option is the animation rigging package. Multi-Aim Constraint | Animation Rigging | 1.0.3
multi_aim

Probably yes, this is what I need. I’ll try it.

Yes, it works, thank you very much!