Error trying to call animation.CrossFade

Hello There:

i got the following:

This script is attached to my player:

But unity displays and error saying this:

An instance of type ‘UnityEngine.Component’ is required to access non static member ‘animation’.

That’s executing the “animation.CrossFade” line.
I really don’t get it, what’s wrong with the “animation” call.

Another thing: The first letter of the script name. It has to be a Capital letter?

i’ll appreciate the help !!

I’m pretty sure you can’t use animation.CrossFade in a static function. if you change your static function to just a normal function it should work fine.

It worked !!

Thnks