mofodox Posted July 18, 2014 Share Posted July 18, 2014 Hello there, I'm fairly new to Phaser.js and I'm having trouble with the console telling me it cannot read the property gravity. Can anyone help me with this? I really appreciate it Link to comment Share on other sites More sharing options...
ZoomBox Posted July 18, 2014 Share Posted July 18, 2014 You don't show enought code. Show us your class, where you're declaring your sprite. The error is pretty self-explaining: Your body is null. That certainly means that you haven't enabled physics on your sprite. Link to comment Share on other sites More sharing options...
lewster32 Posted July 18, 2014 Share Posted July 18, 2014 JavaScript errors are perhaps not written as well as they could be to make it obvious what's going on here, but the key isn't so much that the property gravity cannot be found, but that it's trying to find the property on 'null'. As ZoomBox says, this means that the body itself is missing, not just the gravity property. Link to comment Share on other sites More sharing options...
Recommended Posts