Error CS0103: The name "Debug" does not exist in the current context?
Already have an error for this program, yet it has worked in previous programs. Code:
using UnityEngine;
using System.Collections;
public class TernaryOperatorExample : MonoBehaviour {
public int health = 0;
private string message;
// Use this for initialization
void Start () {
message = health > 0 ? "Player is alive" : "Player is dead";
Debug.Log (message);
}
// Update is called once per frame
void Update () {
}
}
Comment
Your code works flawlessly in my Editor. You problem is likely NOT in this script.
Yeah, even UnityEngine "does not exist in the current context".
Your dlls could have become corrupted. I'd recommend reinstalling the editor, as the simplest solution.
Delete .csproj and .sln files in the project folder and restart $$anonymous$$onoDevelop/Visual Studio.
Your answer
Follow this Question
Related Questions
camera can't focus on player 0 Answers
Wrapping Debug.Assert and skip wrap method in the stack trace 2 Answers
C# float is 0 in debug 2 Answers
GUI not updating after scene change on IAP button click? 1 Answer
Breakpoints not working 5 Answers