Почему ничего не пишет в консоль в Unity

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Main : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            Debug.Log("Space key was pressed.");
        }

        if (Input.GetKeyUp(KeyCode.Space))
        {
            Debug.Log("Space key was released.");
        }
    }
}


Ответы (1 шт):

Автор решения: thinmap

Вы не добавили свой скрипт в какой-либо unity объект.

Ваш скрипт написан правильно, возможно проблема в том что вы не добавили свой скрипт к Unity объекту.

→ Ссылка