Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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:
    213
    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.
     
    h4ni and aa6846283 like this.
  5. mlmey2008

    mlmey2008

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