DonFrag Posted August 4, 2015 Share Posted August 4, 2015 Hello! Does the buttons have a body? because i try this.for(i=0;i<3;i++) { var bSprite=this.mainGame.gameManager.buttons[i].button; this.mainGame.game.physics.enable(bSprite, Phaser.Physics.ARCADE); console.log(bSprite); bSprite.body.velocity.setTo(200,200); bSprite.body.collideWorldBounds=true; bSprite.body.bounce.set(1); }and i get this Uncaught TypeError: Cannot read property 'velocity' of undefined when i check the console.log output the object doesn't have a body property or something. im doing something wrong?PS:Phaser v2.4.2 Link to comment Share on other sites More sharing options...
Recommended Posts