Editor or bug in game

HI i have little issue because when I run game from editor I must toggle the camera and then it sees correctly the city, but at first I see just skybox helipad
so what is the solution?

at first I see just skybox helipad:


then I go to editor and uncheck enabled from camera and check it again and then back to game view:

during of course running game I’m switching from launch to editor and then to launch

Hi @grzesiekmq

From what I understand is when you launch the game, the models don’t appear while the skybox is only visible and you have to check/uncheck the camera to make everything visible. Are you disabling the camera from any of the scripts? If possible, can you make a repro of this in a test project so I can look at it?

No I’m not disabling the camera
but now yes because I changed the 2 lines related to camera
Is this a fix or temp solution?

class PlayerCtrl extends pc.ScriptType {
  initialize() {
    this.speed = 20;

    this.score = 0;

    this.entity.enabled = false;
    this.entity.enabled = true;

  }

this.entity.enabled = false;
this.entity.enabled = true;

Looks like a temporary solution to make it work, but without looking at your project I cannot suggest a fix to this issue.

https://playcanvas.com/editor/scene/1321052 here is the scene of city

I see this extra camera in the hierarchy which is causing the issue, you can remove it and comment out the solution you made, it will work
Screenshot 2022-01-28 182755

2 Likes

ok I now see thanks for help

1 Like

sorry, i know this is a pretty old post but i was wondering where you got that image in the first place, and where was it located?

Hey, that’s a strange one. If the editor and the build aren’t matching up, it usually feels like a caching issue or a script not saving properly. Have you tried force-refreshing the editor or checking the launch tab console for any hidden errors? Sometimes a quick toggle of the “enabled” state on the entity fixes those weird desyncs too.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.