Running project
Introduction
Projects can be played directly from the editor. A project can be composed of multiple scenes and some scripts may be attached to objects in the scene(s).
Here are 2 options:
Here are 2 options:
- play the current scene: all the scripts are compiled on the fly and executed in the current scene that is displayed in the editor, sharing the same resources (textures, etc.). This is the default behavior of the editor.
- play the project as-is: consists on running the command dev using the project's selected package manager (npm, yarn, bun or pnpm).
Playing the current scene
To start the current scene, just click the start buttonlocated in the toolbar of the editor's preview panel.
Each time the current scene is played, the editor will update the assets located in the public folder of the project. If new assets were added to the project (especially images), this can take few seconds too to generate all new necessary files before the project can be played.
Note that when playing, all the scripts are watched for changes and will be reloaded automatically when modified until the "play" mode is stopped.
Stopping the current scene
To stop the current scene being played and get back to the edit mode, just click the stop buttonlocated in the toolbar of the editor's preview panel.
Refreshing the current scene
Sometimes, it's useful to refresh the scene that is being played instead of stopping it and starting it again. This allows to bypass the export process or the editor. Just click the refresh buttonlocated in the toolbar of the editor's preview panel.