Mono broken after upgrade (Not my code!)

Hi All,

Upgraded to 4.2.2f1. Mono will not compile basic code (c#).
It’s as though the compiler is not registering carriage returns/lf’s in the editor. Good clean code triggers novice errors, like forgetting ‘}’.
Apologies if repeat posting, I don’t even know how to search for an issue with a broken text compiler??

Here’s the code.

using UnityEngine;
using System.Collections;

public class PaintLine : MonoBehaviour {

	// Use this for initialization
	void Start () { 
		private LineRenderer lineRenderer;
		private float counter;
		private float dist;
		
		public Transform origin;
		public Transform destination;
		
		public float lineDrawSpeed = 6f;
	}
	
	// Update is called once per frame
	void Update () {
	}	
}

Damned upgrade… lost a few hours and more from this.

Any ideas? Seen this before?

Welcome to the forum!

When you post code, you should use code tags.

I am using 4.2.2 as well, but didn’t face that kind of issue. Did you try to create an empty project add create a handful of scripts in it?

Thanks Dantus for the quick reply. I’ll remember to use tags.

Just created a new project, simplest of scripts, again, below. Still broken.

using UnityEngine;
using System.Collections;

private LineRenderer lineRenderer;

public class DrawLine : MonoBehaviour {
	// Use this for initialization
	void Start () {

	}
	
	// Update is called once per frame
	void Update () {	
	}
}

Windows 8.1?

Win 7 professional, 64 (build 7601).

Actually… It IS your code… Do not declare private/public variables inside method…

using UnityEngine;
 using System.Collections;
     
 public class DrawLine : MonoBehaviour {

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

Thanks.