Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Resolved] Console not showing debug nor print

Discussion in 'Editor & General Support' started by HydroxZ, Dec 5, 2016.

  1. HydroxZ

    HydroxZ

    Joined:
    Dec 5, 2016
    Posts:
    2
    The problem is that yesterday it was showing prints and everything, I didn't touch anything and went to sleep.
    This morning it doesn't show prints nor anything, I even tried to start a new c sharp script and put a basic print to it, but it still doesn't show, I cant find anything on the internet regarding this matter, apart from the usual "Please check that the 3 icons are blabla".

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class NumberWizard : MonoBehaviour {
    5.  
    6.     // Use this for initialization
    7.     void Start () {
    8.     print ("Welcome to Number Wizard");
    9.     print ("Think a number in your head, but don't tell me!");
    10.     int max = 1000;
    11.     int min = 1;
    12.     print ("The highest number you can pick is "    + max );
    13.     print ("The lowest number you can pick is " + min);
    14.     print ("Is the number higher or lower than 500?");
    15.     print ("Up = higher, down = lower, return = equal");
    16.  
    17.  
    18.  
    19.  
    20.     }
    21.    
    22.     // Update is called once per frame
    23.     void Update () {
    24.     if (Input.GetKeyDown(KeyCode.UpArrow))
    25.     print ("Up arrow has been pressed");
    26.     if (Input.GetKeyDown(KeyCode.DownArrow))
    27.     print ("Down arrow has been pressed");
    28.     if (Input.GetKeyDown(KeyCode.KeypadEnter))
    29.     Debug.Log("Enter key has been pressed");
    30.  
    31.     }
    32.  
    33. }
    34.  
    Here is a screenshot
    https://i.imgur.com/auBoaGC.png
     
  2. HydroxZ

    HydroxZ

    Joined:
    Dec 5, 2016
    Posts:
    2
    Resolved by myself, forgot to put the script from the inspector
     
  3. HasanZain

    HasanZain

    Joined:
    Jul 12, 2017
    Posts:
    1
    mine is still not printing and my code is also same, i have taken the same course, and i have tried all of it. it doesnt solve and what do you mean ' from the inspector '
     
  4. Zenix

    Zenix

    Joined:
    Nov 9, 2009
    Posts:
    207
    He means that he forgot to actually attach the script. The code won't run just because it exists in your assets folder, it needs to be attached to a gameobject. You can do this by dragging the script from the project view to one of the gameobjects in the hierarchy.
     
    aa6846283 likes this.
  5. mlmey2008

    mlmey2008

    Joined:
    Sep 14, 2017
    Posts:
    1
    That helped me! Thanks! I was having same issue.
     
unityunity