- Home /
Object disappears on running
Hi I installed unity hub and added editor ''Unity 2021.1.7f1''. I created a 2D square object and added a script to it that i copied from the tutorial i was learning from, VSC shows no error in it as well. Here it is
I attached this script to the square.When i press the run the square disappears from the assets here is a screenshot
Answer by Ermiq · May 28, 2021 at 07:38 PM
The first screenshot is the 'game is running', Unity is in Play
mode. The second screenshot is 'the game is stopped', Unity is in Editor
mode.
You didn't press run
, you actually have pressed stop
and every change you have done in Play
mode have been canceled, including the square.
You need to edit the scene and everything else in Editor
mode. The screen is a bit brighter in this mode and the Play
button is not highlighted. Then you press Play
button to start your game, the screen will become a bit darker (except the Game
window area). And all the changes done in Play
mode are not saved when you click Play
again and stop the game.