Lyian Posted October 11, 2015 Share Posted October 11, 2015 Dear Community, I honestly have no idea what I am doing wrong. Actually I shoot a ball towards a sensor, which kills the ball and reviving it via reset function.But sometimes if i hit the borders near the sensor, which let the ball bounce off towards the sensor, sometimes the physics will be applyied after reviving it. White.prototype.update = function() { if (this.foul){ console.log(placeIndex); this.body.data.shapes[0].sensor = true; this.body.onBeginContact.add(this.enter); this.body.onEndContact.add(this.leave); if(this.game.input.activePointer.isDown){ placeIndex = placeIndex.filter(function(n){ return n != undefined }); placeIndex = placeIndex.filter(Boolean); if (placeIndex.length == 0){ placeNumber = 0; placeIndex = []; this.foul = false; } } }else{ this.body.data.shapes[0].sensor = false; } },White.prototype.test = function(){ this.kill(); this.body.velocity.x = 0; this.body.velocity.y = 0; this.reset(300,300); this.move(); }White.prototype.move = function(){ this.foul = true;}I actually want to avoid that the ball has any physics applied to it after bouncing into the sensor after reviving it. Link to comment Share on other sites More sharing options...
jmp909 Posted October 12, 2015 Share Posted October 12, 2015 is this Phaser 2? In which case you're in the wrong forum. This is for Phaser 3 (which essentially doesn't exist yet)You're best raising your questions herehttp://www.html5gamedevs.com/forum/14-phaser/ThanksJ Link to comment Share on other sites More sharing options...
Recommended Posts