troubleshooting.rst 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .. include:: ../_header.rst
  2. Troubleshooting
  3. ---------------
  4. This is a chapter dedicated to common mistakes or issues you can find using the |SceneEditor|_.
  5. Scene dependencies model
  6. ````````````````````````
  7. The |SceneEditor|_ is a complex tool. It depends on the state of the whole project. A change in an asset file, a |AssetPackFile|_ or a prefab_ file, can affect to the |SceneEditor|_ content. For that reason, you may find a glitch or something weird in the editor, like an object without an image or an object with an out-dated image. In this case, you can do any other following steps:
  8. * Execute the **Refresh Scene** command: press ``Ctrl+Alt+U`` or find it in the context menu.
  9. * Reload the project assets: press ``Ctrl+Alt+R`` or click on the **Reload Project** option in the |MainMenu|_.
  10. Outdated generated code
  11. ```````````````````````
  12. It is possible that when you execute the game, the scene you see is different. A possible cause could be that the scene was not re-compiled after a prefab_ file change.
  13. If you change a prefab_ file, for example, you change the type of the `prefab object <../scene-editor/prefab-object.html>`_, then you should re-compile all the scenes referencing that prefab_ file. The quick solution is to re-compile the whole project: press ``Ctrl+Alt+B`` or select the **Compile Project** option in the |MainMenu|_.
  14. Duplicated scene identifier
  15. ```````````````````````````
  16. Each scene file has an identifier that should be unique in the project. When you create a new scene file, a new identifier is generated for it. However, if you copy the content of a scene file and create a new file with it, then you will get different files with the same identifier.
  17. If it is the case, the editor will show an error message with the files with the same identifier:
  18. .. image:: ../images/scene-editor-troubleshooting-duplicated-id-msg-08122020.webp
  19. :alt: Duplicated scene ID message.
  20. You must fix that error because it could create unexpected behaviors.
  21. To fix it, open the |CommandPalette|_ (``Ctrl+K``) and run the **Fix Duplicated Scenes ID** command.
  22. This command will generate a new identifier for all the scene files that share the same identifier. Only the original file is not modified, in this case, the file with the older modification time.
  23. We recommend to use the **Fix Duplicated Scenes ID** command, but you can modify the scene identifier manually. Just open the file in a text editor and change the ``id`` field.
  24. .. code::
  25. {
  26. id: "write-here-a-unique-identifier",
  27. // ...
  28. }
  29. The |SceneEditor|_ uses the ``Phaser.Utils.String.UUID()`` function to generate a new identifier. You can do the same.
  30. Disable Pixel Art rendering
  31. ```````````````````````````
  32. By default, the |SceneEditor|_ creates a game with the `pixelArt` rendering flag enabled. You can change this configuration by executing the **Scene Editor: Disable Pixel Art Rendering** command and refreshing the page.