So I’m trying to learn ow to animate a character for use. After trying to assign “IsJumping” to “Jump” how ever it comes up with this error. “NullReferenceException: Object reference not set to to an instance of an object AnimationController.Update() (at Assets/AnimationController .cs:17)”.
Here is the code. As stated in the error the line in question is line 17.
using UnityEngine;
using System.Collections;
public class AnimationController : MonoBehaviour {
static Animator animator;
void start ()
{
animator = GetComponent<Animator>();
}
void Update ()
{
if(Input.GetButtonDown("Jump"))
{
animator.SetTrigger("IsJumping");
}
}
}