outside the Update function it doesnt work because unity is not checking if the player is clicking on up EVERY FRAME
i want it to happen on a function i create that isnt getting update every frame, a function that go row, row, row until it reaches it end. is there a way doing that?
The editor is freezing because you are only yielding the coroutine if there is input, so when there is no input you are creating an infinite loop. Try adding a yield like this:
function WaitInput(key : String) { // this need to be a coroutine
while(Application.isPlaying)
{
if(Input.GetButtonDown(key)){
yield;
}
yield;
}
}