Sign in to follow this  
Pillan

How do I update console.log?

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.