Search Unity

Help! My script isn't working!

Discussion in 'Unity Hub' started by heiwah12, Jun 8, 2019.

  1. heiwah12

    heiwah12

    Joined:
    Jun 8, 2019
    Posts:
    1
    I am new to programming in general. I am currently learning C#.
    "Game started" is not showing up on the game screen. I don't know what to do!

    my script is below.

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

    public class ExitScript : MonoBehaviour
    {
    // Start is called before the first frame update
    void Start()
    {
    print("Game Started");
    }

    // Update is called once per frame
    void Update()

    {

    }
    }
    "
     
  2. Makkkkus

    Makkkkus

    Joined:
    Aug 6, 2017
    Posts:
    4
    Debug.log(); instead of print.
     
  3. https://docs.unity3d.com/ScriptReference/MonoBehaviour-print.html

    Please use code tags when you post code on the forums. You can find the button in the toolbar when you edit your message. Also please choose the forum you're posting in carefully. This is not a Scripting help forum, it's only about the Unity Hub. Next time please post in the Scripting forum if you need help with scripts.
    The Game Started text should not show up in the game window, it should show up in the Console window. Unless you have other errors.
     
    safaGH likes this.