[SOLVED] Skybox ignore me

Hello, i have assigned a skybox in the editor and now working on a day/night cycle so i want to change the skybox and as well the directional light. The light changes as expected, the skybox (that isn’t shown when i start the scene) does not change when the script for change it is runned too. I have set the 2 script attributes with 2 different skyboxes and have the following script

           if (this.hour==='day') {
                this.hour='night';
                this.cubenight.loadFaces = true;
                app.scene.skybox=this.cubenight;
                app.scene.fogColor=new pc.Color(0,0,0);
                app.scene.skyboxMip = 1;
                this.light.light.color= new pc.Color(0,0.1,0.3);
            } else {
                this.hour='day';
                this.cubemap.loadFaces= true;
                app.scene.skybox=this.cubemap;
                app.scene.fogColor=new pc.Color(0.3,0.4,0.5);
                app.scene.skyboxMip = 1;
            }

what do i miss? Tanks a lot (PS the fog change color as expected)

@yaustar working with old scripts :stuck_out_tongue: so some command is different

I can’t see anything in there that would be affected by old scripts as the functions called on assets and non-script objects?

if i use this app.scene.setSkybox(this.cubemap.resources); it give me a grey sky.
I have pc.script.attribute(‘cubemap’, “asset”,[]); to set cubmap and nightmap attributes
and since some time ago with just this

app.scene.skybox=this.cubemap;
app.scene.skyboxMip = 1;

it worked perfectly, but now if i lunch the scene also the initial skybox is not displayed (i mean the one set into editor).
EDIT: if the scene is open and i modify the mip to 2 into editor, the skybox appear (but it doesn’t change when it should)

          if (this.hour==='day') {
                this.hour='night';
                this.cubenight.loadFaces = true;
                app.scene.skybox=app.assets.get(this.cubenight[0]).resource;
                app.scene.skyboxIntensity=1;
                app.scene.fogColor=new pc.Color(0,0,0);
                app.scene.skyboxMip = 1;
                this.light.light.color= new pc.Color(0,0.1,0.3);
            } else {
                this.hour='day';
                this.cubemap.loadFaces = true;
                app.scene.skybox=app.assets.get(this.cubemap[0]).resource;
                app.scene.fogColor=new pc.Color(0.3,0.4,0.5);
                app.scene.skyboxMip = 1;
                this.light.light.color= new pc.Color(0.7,0.7,0.7);
            }