Jump to content

rotation tween is not working properly


Rocco
 Share

Recommended Posts

var tween = this.add.tween(s.angle).to({angle:s.angle +=90}, 850, Phaser.Easing.Linear.None, true, 100);

this is my code, and something must be wrong with it.

it does the rotation, but immediatly like the code is only

s.angle +=90;

without the tweening effect, don't know why.

thanks for help!

Link to comment
Share on other sites

This part: s.angle +=90

That is not needed, you only need to have +90 in there.

 

Also, what you are attempting to tween there is s.angle.angle.

Try:

var tween = this.add.tween(s).to({angle:'+90'}, 850, Phaser.Easing.Linear.None, true, 100);
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...