Night Day Cycle Scene Switcher with timer

Night Day Cycle Scene with timer - a demo / reusable project I have created that you can fork and re-use in Playcanvas that switches before day and night scenes after a given set of time

Direct Link to fork project -

video covering using it here -

Thank you for sharing, @Chris_Godber!

I wonder if you could make the day gradually change to night? I have no idea how to do it, honestly :slight_smile: Probably by doing some magic with the cubemap? Thinking out loud.
Don’t give up on your mafia game :slight_smile: I will look forward for the next update.

Play around with this inside the update() of the orbit-script;

    var camera ="Camera"); = camera.getEulerAngles().y/180; = 6/(camera.getEulerAngles().y+1);

and one/you will get the effect of cubemap and/or background fading in/out while preserving light on objects (like at the BMW i8 example here)


PS: Not sure there is a cubemap on the orbit-example, though - to be put there for ‘full’ effect

Yes, @Thomas_Due_Nielsen gave a good option. This would mean you would need to stay within a single scene - which is a good thing, as you would no longer need to sync the game states between day and night.

1 Like