Auto generated default C# script giving error ?

Hello everybody.
Something weird is going on. I created a new script on the Assets folder named “2DRaycaster”, and then I double-clicked it, to open it in Visual Studio and edit it.

The moment it loads in VS, before I change anything to it, it has red lines and 12 errors.

The script’s code is this:

using UnityEngine;
using System.Collections;

public class 2DRaycaster : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}

l

And I get “A namespace cannot directly contain members such as fields or methods”.
Why is that ?

C# classes have to start with a letter. You can’t start it with a ‘2’.

Thank you very much! :slight_smile: