#Unity crashing

1 messages · Page 1 of 1 (latest)

coarse kiln
#

When i run this script unity basicly crashes and i dont know why (i cant pres anything or stop the game runing it dosent close the scren) . I dont even now if the code could be simpler becouse im basicly a beginer and just using things that i know alredy . I would be realy grateful if someone could help

severe shell
#

[]cb

jagged totemBOT
#

Use codeblocks to send code in a message!

To make a codeblock, surround your code with ``` (3 backticks. Click here to see where the key is)

To use syntax highlighting, add the file extension of the language you wish to highlight (cs for C#, cpp for C++)

For example:
```cs
Console.WriteLine("Hello World");
```

Produces:

Console.WriteLine("Hello World");

To send lengthy code, paste it into https://paste.myst.rs/ and send the link of the paste into chat.

severe shell
#

@coarse kiln

coarse kiln
pale crag
#

infinite while loop

#
            {
                audioSource.Play();
                if (Input.GetMouseButtonDown(0))
                {
                    Debug.Log("sucses");
                }
                else
                {
                    isCoroutineRunning = false;
                    elapsedTime = 0;
                }
            }```
#

no yield return

#

no execution pauses (even yield return null pauses for a frame)

#

code like bool == true or bool == false can be written as bool or !bool --They work the same--

#

@coarse kiln

coarse kiln
#

Whont it end when elapsed time is grater then 3?

pale crag
#

so elapsedTime can't increase

coarse kiln
#

But if i put it in front it wont increase either?

pale crag
#

it should be in the while

pale crag
coarse kiln
pale crag
coarse kiln
pale crag
coarse kiln
#

It pauses the hole frame?

pale crag
pale crag
coarse kiln
pale crag
coarse kiln
#

Okkk thanks

pale crag
coarse kiln
#

Its suposed to play a sound ant then wait for the player to enter a buton in a certain amount of time and then it just debugs if the key was enterd(i wil do some more stuf in the future but this is wat i want it to do)

pale crag
coarse kiln
#

That should work?

pale crag
#

shouldn't it be before loop?