Search Unity

Can't get debug.log to work

Discussion in 'Scripting' started by SammyWest, Sep 19, 2020.

  1. SammyWest

    SammyWest

    Joined:
    Dec 19, 2014
    Posts:
    14
    This is my code

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using System.Diagnostics;
    4. using UnityEngine;
    5.  
    6. public class script : MonoBehaviour
    7. {
    8.     // Start is called before the first frame update
    9.     void Start()
    10.     {
    11.         Debug.Log("I am alive!");
    12.     }
    13.  
    14.     // Update is called once per frame
    15.     void Update()
    16.     {
    17.        
    18.     }
    19. }
    20.  
    21. It doesn't want to call the code. I'm sure this has been asked before, but its driving me insane.
     
  2. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106
    Is the script enabled in the scene?
     
  3. SammyWest

    SammyWest

    Joined:
    Dec 19, 2014
    Posts:
    14
    Yes, I put it on the camera object, and have been testing different debug methods, and none of them work.
     
  4. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106
  5. SammyWest

    SammyWest

    Joined:
    Dec 19, 2014
    Posts:
    14
    upload_2020-9-19_2-25-18.png

    Sorry for the desktop lol
     

    Attached Files:

  6. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106
    Ah, I see.
    Remove this from the top of your script:
    Code (CSharp):
    1. using System.Diagnostics;
     
  7. SammyWest

    SammyWest

    Joined:
    Dec 19, 2014
    Posts:
    14
    oh thank you so much! That was annoying, i don't know why visual script puts that as a library automatically, that broke it. omg i thought i was gonna go insane lol. Thats why i love python. so simple. lol