Search Unity

Question why Im not getting notification debug log in console ?

Discussion in 'Unity Gaming Services General Discussion' started by LittleBicthFromHeaven, Jan 28, 2023.

  1. LittleBicthFromHeaven

    LittleBicthFromHeaven

    Joined:
    Jan 28, 2023
    Posts:
    1
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class Player : MonoBehaviour
    {
    // Start is called before the first frame update
    void Start()
    {

    }
    // Update is called once per frame
    void Update()
    {
    //Check is space key is pressed down
    if (Input.GetKeyDown(KeyCode.Space))
    {
    Debug.Log("Sapace Key Was Pressed Down");
    }
    }

    }
     
  2. Julian-Unity3D

    Julian-Unity3D

    Unity Technologies

    Joined:
    Apr 28, 2022
    Posts:
    192
    Make sure your console is set to show logs.

    upload_2023-1-30_10-50-34.png

    Click this button while game is running, and try again.

    Code looks fine.
     
  3. tony_c-unity3d

    tony_c-unity3d

    Unity Technologies

    Joined:
    Jul 18, 2019
    Posts:
    35
    Another common mistake is not attaching it to any game object. Be sure to use the [Add Component] button on a game object that's active in your scene, otherwise nothing would actually be executing the script so no logs would appear.
     
    Julian-Unity3D likes this.