Search Unity

[SOLVED] print and Debug.Log don't working

Discussion in 'Scripting' started by Recksarr, Aug 25, 2019.

  1. Recksarr

    Recksarr

    Joined:
    Aug 25, 2019
    Posts:
    4
    Hello everybody! I have a problem with Unity 5.6.7 and need your help. If simply print and Debug.Log don't working outside Start () or Update () functions. I've tried to delete and create this script, tried different objects to contain it, tried to deactivate/activate script and object, but print and Debug.Log still don't working. I haven't ever met such problem. Thanks for your answers!
     
  2. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    2,495
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    5,426
    in the console window, top right, check that log is enabled,

    enabled: (toggled on)
    upload_2019-8-25_18-44-43.png

    disabled (toggled off)
    upload_2019-8-25_18-45-6.png
     
  4. Recksarr

    Recksarr

    Joined:
    Aug 25, 2019
    Posts:
    4
    I think it's not needed. For described case i took simple

    void Hellohello () {
    print ("Hello!");
    }

    And I still don't see "Hello!" message. Note that all flags above are turned on
     
  5. Recksarr

    Recksarr

    Joined:
    Aug 25, 2019
    Posts:
    4
    I tried toggle them on and off, but result is staying same
     
  6. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    2,495
    If you don't call HelloHello() in Start(), Update() or other functions, "Hello!" will never print.
     
  7. Recksarr

    Recksarr

    Joined:
    Aug 25, 2019
    Posts:
    4
    Thank you! It really helped, I completely forgot to call it! Thank you, once more!