Jump to content

How do I update console.log?


Pillan
 Share

Recommended Posts

console.log just outputs a static message to the console. You can't update it from your game code.

The lazy solution for this would be to log the body every frame (in the update method). That'd work but it'd clutter the console really quickly and is probably not what you want.

The Chrome developer tools support a feature called live expressions - it's the eye icon right above the console. If you can get to your player from the window's scope, you can make a live expression which updates it for you. The easiest way would be to temporarily store the player as a global variable from your code. Alternatively, you can store your game and use the Scene Manager to get your Scene, from which you'll be able to get your player.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...