.IsPlaying does not exist?

I’m having trouble with .IsPlaying for c#. I looked at the scripting reference for animation and isPlaying and IsPlaying is in there. When I used it in my script, it was acting like it was unknown or didn’t exist in any way!
I get this error: “error CS1061: Type UnityEngine.Animator' does not contain a definition for IsPlaying’ and no extension method IsPlaying' of type UnityEngine.Animator’ could be found.”

Here’s an example:
if(anim.IsPlaying(“animation”)){
print(“animation is playing”);
}

Yes, I’ve set a variable for the animator, and yes, I’ve typed it in correctly.

This has to be a bug if it exists but thinks it’s an error.

UnityEngine.Animator’ does not contain a definition for IsPlaying’ and no extension method IsPlaying’ of type UnityEngine.Animator’ could be found."
This is not a bug, and the error isn’t lying. Animator does not have a definition for IsPlaying. Perhaps you meant to use Animation?

Script Reference – Animation.IsPlaying