#States woes

4 messages · Page 1 of 1 (latest)

median hamlet
#

Hi, I am trying to add a main menu to my game, so I'm transitioning to using States and have 2 issues that I can't figure out yet.

  1. How to view world inspector after transitioning state? When in the MainMenu state (2d) it works, but after it transitions to the Game state (3d) it no longer appears at all. I suspect the issue is related to Cameras because if I add a Camera2d to my 3d scene, then the world inspector appears, but only where the clear color appears (meshes visually block the inspector window, but it's visible in the sky). Also this is not a good approach because it floods my log with warnings about having two cameras. What am I doing wrong; how do I view the inspector window in a 3d scene?
  2. One of my meshes is not appearing when spawned in the OnEnter(GameState::Game) schedule, but it does appear when spawned from the Startup schedule. I have triple checked that the system is indeed running, and everything else in that system works, and the entities even exist correctly with all the components, but the mesh and collider are both absent from the simulation and rendering. Anybody seen an issue like that before or have any guesses?

Thanks in advance.

median hamlet
#

I solved #2! I am procedurally generating the mesh and settings the RenderAssetUsage to only RENDER_WORLD but I added MAIN_WORLD to it and it works. It seems spooky that rendering it does not work with only RENDER_WORLD. I am generating the mesh in a Resource's FromWorld during plugin initialization, but the difference is, it works when spawning a Mesh3d in Startup, but it does not work when spawning a Mesh3d on state transition. This feels like a bug, but maybe I'm not understanding it fully.

I'm still wondering how to use the inspector when transitioning from a 2d to a 3d scene. Thanks in advance!

distant blaze