# Tween with Real Time? (Solved)

**URL:** <https://phaser.discourse.group/t/tween-with-real-time-solved/2020>\
**Category:** Phaser 2 / CE\
**Created:** [April 8, 2019, 7:38am UTC](https://phaser.discourse.group/t/tween-with-real-time-solved/2020 "2019-04-08T07:38:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Temms](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/temms/32/870_2.png) [@Temms](https://phaser.discourse.group/u/Temms)\
**Post date:** [April 8, 2019, 7:38am UTC](https://phaser.discourse.group/t/tween-with-real-time-solved/2020/1 "2019-04-08T07:38:04Z")

</div>

![Capture](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/3/3330edd9ead4f84e84083b9814d1587b1b232f4b.png)

If I wanted to move objDuck from point A to point B on the screen within 2 seconds, insert 2000 in the speed var.  
tweenDuck = this.game.add.tween(objDuck).to( { x: pointB.x, y: pointB.y }, speed, Phaser.Easing.Linear.None, true);

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [April 8, 2019, 4:46pm UTC](https://phaser.discourse.group/t/tween-with-real-time-solved/2020/2 "2019-04-08T16:46:00Z")

</div>

I believe tweens are time based, not frame based.

---

<div class="post-metadata">

**Author:** ![Temms](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/temms/32/870_2.png) [@Temms](https://phaser.discourse.group/u/Temms)\
**Post date:** [April 9, 2019, 1:36am UTC](https://phaser.discourse.group/t/tween-with-real-time-solved/2020/3 "2019-04-09T01:36:04Z")

</div>

Thank you so much, I have figured out that 1000 in the speed var = 1 sec

---

<div class="post-metadata">

**Author:** ![AdelMahjoub](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/adelmahjoub/32/1147_2.png) [@AdelMahjoub](https://phaser.discourse.group/u/AdelMahjoub)\
**Post date:** [April 10, 2019, 8:34am UTC](https://phaser.discourse.group/t/tween-with-real-time-solved/2020/4 "2019-04-10T08:34:55Z")

</div>

There is the `moveTo` methods in `Phaser.Physics.Arcade`, such as [https://phaser.io/docs/2.6.2/Phaser.Physics.Arcade.html#moveToXY](https://phaser.io/docs/2.6.2/Phaser.Physics.Arcade.html#moveToXY)  
It takes both time and speed params, if the speed is too low to reach the target in time it will be overwritten by another value.
