Detect editor playmode from script

Is there a way to detect if the game has been started with the play button in the editor? This would be handy during the development. At least there seems to be some Debug = True on by default. How can I access this info in a script?

image

Hi @jariwake,

An easy way is to check the active url, here is a method:

function startedInLaunch(){
    return window.location.href.indexOf("launch.playcanvas.com") > -1
}
3 Likes