Erreur BCE0019 'animation' is not a member of 'Object'

Hello everyone,
I wrote a script in JavaScript for a game that worked very well, until a error message appears: Assets / scripts / MoveCharacter.js (42,34): BCE0019: ‘Animation’ n is not a member of ‘Object’.
I was told he had to put my character in “Legacy” but it is under “Legacy” and the Problem Persists forever!
Can you help me?
Thank you.

You must type all your variables, and make sure you do not use the JS Array class, but use built-in arrays or generic Lists instead.

–Eric

Thank you for your answer, but I don’t use JS Array class or table in my script.

Then make sure you are typing all your variables.

–Eric

Yes I have already enter all variables.