rtlehr Posted June 23, 2016 Share Posted June 23, 2016 Really sorry if this has been posted and solved, but... I just purchased the Box 2d plugin and it does not seem to work with 2.5. Works fine with 2.1, but when I switch to 2.5 it breaks. Is there a solution for this? Thanks, Ross Link to comment Share on other sites More sharing options...
rich Posted June 23, 2016 Share Posted June 23, 2016 What error do you get in the console? because I tested all the Box2D Examples with 2.5 prior to release, and they all worked fine (just tried a couple again now without issue too) Link to comment Share on other sites More sharing options...
rtlehr Posted June 23, 2016 Author Share Posted June 23, 2016 TypeError: undefined is not an object (evaluating 'this.target.worldPosition.x') updateTarget — phaser.js:28866 below is the JS included into the file. I'm working with the car on terrain.html file <script src="js/phaser.js" type="text/javascript"></script> <script src="js/box2d/box2d-plugin-full.min.js" type="text/javascript"></script> Thank you, Ross Link to comment Share on other sites More sharing options...
rich Posted June 23, 2016 Share Posted June 23, 2016 The problem with that example is the Camera.follow call, it's trying to follow a Box2D Body, which isn't a valid Sprite (it has no worldPosition property, so throws that error). The error is with Camera.follow rather than the plugin. I will see about updating it, though it won't change the plugin itself. Link to comment Share on other sites More sharing options...
rtlehr Posted June 23, 2016 Author Share Posted June 23, 2016 oh, ok... thanks for the quick help. Ross Link to comment Share on other sites More sharing options...
Recommended Posts