moukthik Posted July 25, 2017 Share Posted July 25, 2017 Hi I am new to phaser . I am working on a animation to rotate a glass with lid . when I rotate it ,it rotates anti cliockwise to the left . I want it turn clockwise to right . and when I try to change the pivot position the group position gets changed. Need help . Link to comment Share on other sites More sharing options...
ncil Posted July 25, 2017 Share Posted July 25, 2017 Hi, could you post some of your code so we can take a look? Link to comment Share on other sites More sharing options...
moukthik Posted July 26, 2017 Author Share Posted July 26, 2017 function createGlass() { closedGlass = game.add.group(); closedGlass.create(game.world.centerX+200,game.world.centerY+300, 'glass'); closedGlass.create(game.world.centerX-75, game.world.centerY+80, 'glassLid'); // closedGlass.pivot.x = 5; // closedGlass.pivot.y = 5; closedGlass.position.x = 100; closedGlass.position.y = 150; closedGlass.scale.set(scale,scale); game.physics.p2.enable([closedGlass], false); block.body.static = true; closedGlass.children[0].body.static = true; closedGlass.children[1].body.static = true; } function playAnim(){ game.add.tween(closedGlass).to({ rotation: -1 }, 2000, Phaser.Easing.Linear.None, true); } Link to comment Share on other sites More sharing options...
Recommended Posts