Rory Posted November 14, 2018 Share Posted November 14, 2018 Hey good people of the html5gamedev world. I've created a simple moving platform using a tween but the player's interaction with the platform is a little off. The screencast sums it up. Basically, I would expect my character to fall down when the platform is no longer under them? I'm sure I'm making some newbie mistake here. Any suggestions? I can post the code if need be. Link to comment Share on other sites More sharing options...
samme Posted November 14, 2018 Share Posted November 14, 2018 Turn on physics debug. Link to comment Share on other sites More sharing options...
Rory Posted November 14, 2018 Author Share Posted November 14, 2018 Thanks for the reply. Nice, I didn't know there was a debug mode. I'm still very new to this. The blue box, (I guess it's a collider outline?) is not moving with the platform. Here's the code I'm using to create the platform and the tween. addMovingPlatform() { //this.myMovingPlatforms was returned from earlier call to this.physics.add.staticGroup(); this.myMovingPlatforms.create(48*8, 48*5, 'movingGround').refreshBody(); this.tweens.add({ targets: this.myMovingPlatforms.getChildren()[0], x: '+=48', ease: 'Power1', duration: 3000, yoyo: true, repeat: -1 }); } Anything fundamental I'm missing here? Link to comment Share on other sites More sharing options...
Rory Posted November 14, 2018 Author Share Posted November 14, 2018 Hmm, me thinks perhaps it's because I'm using staticGroup() for my platform... ? let me rejig this a little.. [edit] yup, changing from a staticGroup() object did the trick. Thanks. Befive.Info 1 Link to comment Share on other sites More sharing options...
Recommended Posts