Trying to get animation to work. Problem with JS.

Hi. I’m asking this because I am a complete beginner to unity and honestly have no idea what to do. I want to add an animation to a weapon that a character in my game will hold, however the javascript script creates errors even though it should be correct. How can I create a basic script that checks for keypresses and when it detects it plays an animation in C#? I haven’t learned C# whatsoever so feel free to recommend any learning resources if you know any. Thanks!

Hi ,watch this,It might be helpful.(It’s a 2d animation ,only c#)

https://streamable.com/igrcx