if (raycastHit.transform.name == "stop") {
Application.Quit();
}
But it doesn’t work mabey I do something wrong, anyone can help me?
I created a restart button it worked, but I also want to close the game by clicking on the quit button in the game.exe
Application.Quit doesn’t work in the editor, it only works in an actual build. If that’s not the problem, then we’re going to need a lot more code than just those two lines to tell you what’s wrong… I’d guess maybe you don’t have a collider on your button or the object the collider’s on isn’t actually named “stop”.