double output even though it should be possible C#
The console says "Hello World" twice when it should say it once, I'm not the best at coding, but It shouldn't output it twice once it was told the first time to stop.
void Update() {
if (endOfThisScript == false)
{
if (openinglogo.startTheGame == true)
{
Debug.Log("Hello World");
endOfThisScript = true;
}
}
}
Answer by NoseKills · Aug 27, 2016 at 08:18 AM
Maye you have more than one of that script in your scene?
Try changing it to Debug.Log("Hello World!" + GetInstanceID() );
to see if there's multiple instances.
the problem was there was multiple objects in the hierarchy with the script attached to it. took a while to find what it was attached to, thanks for the help, I feel dumb
Your answer
Follow this Question
Related Questions
How to change the player gravity level?,How to change the value of the players gravity? 1 Answer
Why doesn't this if-statement work? 1 Answer
C# float variable isnt behaving like its value 1 Answer
Changing an argument to a var and vice-versa 0 Answers
How to Modify a java Script variable with a c# Script 1 Answer