After i click play my game ends any help?
Um, it is difficult to guess what the issue might be without more information. It is possible when you click the play button and are waiting for it to play, you click it a second time which kicks it back out of play mode. Try clicking the button only once and waiting to see if it works.
If that is not the issue, make sure you don’t have any code that is forcing your project to quit playing immediately. I would try removing, or disabling, object in your scene and trying the play button again to see if anything seems to be causing this behavior.
Check if you are using
Application.Quit(); //(An optional exit code to return when the player application terminates on Windows, Mac and Linux. Defaults to 0.)
in backend of this button.
if not!! please give more detail that what code is written in backend.