- Home /
Nothing in the console
Hello,
I'm trying to run the following program:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Ternary : MonoBehaviour {
public string user;
string console;
void OnDisable(){
console = (user != "") ? "Please enter a name" : "Hello " + console + "!";
}
}
Upon putting a name for user in Unity, and disabling my object, nothing is displayed in the console. Is there something wrong with Unity or the code? Thanks!
Comment
Best Answer
Answer by hexagonius · Mar 27, 2018 at 05:27 AM
console is just a string. if you want to see it, use Debug.Log
Your answer
Follow this Question
Related Questions
5.4 Console Window Won't Automatically Update With Logs/Errors 0 Answers
Console not outputting from Debug.Log() 10 Answers
Writing to Monodevelop's "Application Output" window 3 Answers
Is Unity console output stored anywhere on iOS devices? 1 Answer
Same output_log.txt file being written to by multiple clients at once? 0 Answers