Pillan Posted December 14, 2018 Share Posted December 14, 2018 I'm trying to debug my player.body in the console.log I have console.log(player.body) in the create function. How do I update the console.log(player.body) ? Link to comment Share on other sites More sharing options...
Telinc1 Posted December 14, 2018 Share Posted December 14, 2018 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. Pillan and mapacarta 2 Link to comment Share on other sites More sharing options...
Recommended Posts