Console not working help please....

my console.Log is not working!!! ive tryed everything…

Do you really mean console.Log? Or do you mean Debug.Log? Please post your code (using code tags), and a screen shot of your Console pane, so we can see whether you have the info messages turned off.

using UnityEngine;
using System.Collections;

public class NewBehaviourScript1 : MonoBehaviour {

    public int[] Ages = { 18, 20, 22, 24, 26 };
    public string[] names = { "a","b","c","d","e"};
   
    // Use this for initialization
    void start()
    {
        Debug.Log(Ages[4]);
        Debug.Log(names[4]);

    }
    void update()
    {
        //this is additional to see if my other code doesnt work will this work.
        UnityEngine.Debug.Log("info");
    }
   
   
}

will this be of any benefit
got it from the editor log…

S’W’iindows 10 (10.0.0) 64bit’ Languauag: ee: ‘en’ Physical Memory: 3980
MBa
tchMode: 0, IsHumanControlrollingU1, StartBugReporterOnCrash: 1, I, Is64bit: 1sPro: 0
0
Inntiatialize mo
noon

Ah, OK, the Debug.Logs are working fine. The problem is that your code is not running. “start” and “update” are not magic methods (though “Start” and “Update” are).

Normally, with a fresh install of Unity, you get a new-script template that has both of these methods included (correctly). How did you end up with these incorrect versions?

3 Likes

Just to clarify what is being said here, Unity’s languages are case sensitive. A function named “start” is not the same as a function named “Start”. The engine expects both methods to be capitalized according to how they appear in the API docs.

https://docs.unity3d.com/ScriptReference/MonoBehaviour.html

4 Likes

omg !!! joe , Ryiah : thank you soo much ,may allah bless you. honestly i feel ilke punching myself i checked everything there is on the internet even editor log (lol) i was worried thinking that unity’s knackered …

can i ask you “Ryiah,joestrout,boredmormon” -something hope you guys reply

  1. do you guys work for unity or something or just active and like helping people:]
    2)Joe how did you find this silly mistake/error , i compared it to the original copy aswell and couldnt find the error…

We don’t work for Unity; we just like to help out when we can.

You learn to watch for things like that. When it seems your code isn’t doing anything, your first thought should be: “Wait, is this code even running at all?”

2 Likes

Solving problems requires us to know the solution and since we don’t always know it that leads to us learning too. :wink:

2 Likes

Hello, I am a beginner in Unity, I have version 5.3.0f4. I tried a very simple experiment to try to design a game to move a cube, but I had a problem I wrote my own script to try it, but the game does not work and my script does not affect the game at all. I wrote hello im a cube but it does not appear in the console . It should be noted that there is no error. My script does not affect Unity and does not appear in console any help ???,

Hi there, just a few things:

  1. You should create your own thread with this issue instead of replying to another thread that is unrelated to it.
  2. Unity 5.X.X is pretty old at this point. If you’re just starting out fresh, why not use a more recent version? The latest version at the time of this post is 2019.3.10f1.
  3. Please post your scripts using the forum’s code tags so we can see what may be causing the problem. ( See how to use code tags here ).

You should probably start your own thread instead of hijacking an old unrelated thread. You’ll also have to be much more specific if you want any help. You’re basically saying your car doesn’t move, and expecting the mechanic to know what is wrong just from that.