Hello, I followed a youtube video and wrote the code exactly as he did, but mine gets four errors, while his doesn't. I don't know if it's because we're using different versions of unity (Me: Unity 5, him: whatever one was around in 2011) or what happened. Here's the full code:

using UnityEngine; using System.Collections;

public class Chest : MonoBehaviour { public State state;

public enum State
{
open,
close,
inbetween
}

void Start()
{
State = Chest.State.close;
}

void Update()
{

}

public void OnMouseEnter ()
{
Debug.Log ("Enter");
}

public void OnMouseExit ()
{

}

public void OnMouseUp ()
{
if (State == Chest.State.close)
Open ();
else
Close ();
}

private void Open()
{
Animation.Play ("OpenAnime");
State = Chest.State.open;
}

private void Close()
{

}


}

First two errors say "The left-hand side of an assignment must be a variable, a property, or an indexer." This is referencing lines 17 & 46.

Third error says "Expression denotes a 'Type', where a 'variable', 'value' or 'method group' was expected." This one is referencing line 37.

The last error says " An object reference is required to access non-static member `UnityEngine.Animation.Play()'", and is referencing line 45.


I came to this site because no one is answering any questions on the Unity Answer forums and the moderator(s) are taking 2 hours to approve a question. This project is due in about an hr & half. I've been working on this for weeks.