Djloop Posted August 29, 2017 Share Posted August 29, 2017 Hi, Im having an issue with tweens. Its a bit difficult to explain, so please bare with me.. this.tween = this.game.add.tween(this.itemToTween).to({ y: y+100 }, 100); It is a quick tween over a relatively large distance that is repeated many times. If the itemToTween is moved by say 15 pixels per frame (for example), the last frame is moved only 10 pixels to exactly end at position y+100. This 10 pixel move in the last frame as apposed to the normal 15 pixels per frame is causing hiccups/staggering on the tween repeat and other running tweens on other items are becoming out of sync position wise. The only solution I could think of was maybe doubling the distance and time of the tween and then manually checking on the tween update if the position is greater than y+100. In that case stop the tween and trigger the new tween and subtract the distance the original tween shot over y+100. This seems like such a hack though... Does anyone have a suggestion on a cleaner solution? Thanks. Link to comment Share on other sites More sharing options...
samme Posted August 29, 2017 Share Posted August 29, 2017 Try this.tween.frameBased = true; Link to comment Share on other sites More sharing options...
Djloop Posted August 29, 2017 Author Share Posted August 29, 2017 Would that not cause my tween to run slower/faster on slower/faster devices? Link to comment Share on other sites More sharing options...
samme Posted August 29, 2017 Share Posted August 29, 2017 I don't think so. Link to comment Share on other sites More sharing options...
Recommended Posts