How to check if a rigidbody is moving?

Apologies if I’m in the wrong place but I need help with a very simple script, all I need to happen is if a rigidbody is moving, play walking animation and else the idle animation. I understand Input.Getaxis but obviously it’s for input and I need it to happen when the enemy gives chase. Any help would be greatly appreciated! Thanks.

Check its velocity: Unity - Scripting API: Rigidbody.velocity