Hi
So Im making a new game, my first game aswell but I am struggling to make my code work. I do have experience in visual basic so im not a complete noob but i have never done unity. Anyway I have a sledge hammer and have made an animation, I just cant get my code to work. Here it is so far but I get the error: NullReferenceException: Object reference is not set to an instance of an object. Here is my current code
function Update ()
{
var hammerswing : AnimationClip;
if(Input.GetMouseButtonDown(0))
transform.Animation.Play("Hammerswing");
}