Skip to content

Commit ab8ad19

Browse files
authored
Merge pull request phaserjs#5208 from samme/fix/arcade-physics-body-prev
Fix incorrect Arcade Body delta
2 parents 6bd24de + 807aeed commit ab8ad19

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/physics/arcade/Body.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ var Body = new Class({
160160
* @type {Phaser.Math.Vector2}
161161
* @since 3.0.0
162162
*/
163-
this.prev = new Vector2(gameObject.x, gameObject.y);
163+
this.prev = this.position.clone();
164164

165165
/**
166166
* The position of this Body during the previous frame.
@@ -169,7 +169,7 @@ var Body = new Class({
169169
* @type {Phaser.Math.Vector2}
170170
* @since 3.20.0
171171
*/
172-
this.prevFrame = new Vector2(gameObject.x, gameObject.y);
172+
this.prevFrame = this.position.clone();
173173

174174
/**
175175
* Whether this Body's `rotation` is affected by its angular acceleration and angular velocity.

0 commit comments

Comments
 (0)