New C# scripts in 2018.1.2f1 don't derive monobehaviour
I updated to Unity 2018.1.2f1, but for some reason new C# scripts don't seem to highlight key words. Because of this, I can't autocomplete Unity keys (Like Transform or Gameobject). I am also unable to reference Monobehaviours in other scripts. For example, see the code below:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class crosshairHitDetection : MonoBehaviour {
private bool isTriggered;
void OnTriggerEnter2D(Collider2D col) {
isTriggered = true;
}
void OnTriggerExit2D(Collider2D col) {
isTriggered = false;
}
}
It's simple enough, but notice how in this screenshot, the MonoBehavior is not lighting up as green, signifying that is is a key name.
But it does highlight in this other script:
I am unable to reference the Monobehaviour "crosshairHitDetection" from the first screenshot like I am with "characterController" in the 2nd screenshot, because the code will not compile, because of this.
Are you sure you created the script inside your assets folder? And if so, is it correctly inside your code editor? I don't know much about monodevelop.. Visual studio is a better tool imo..