Skip to content

Commit b90d7b2

Browse files
authored
Merge pull request phaserjs#2654 from leopoldobrines7/fix-function
Fix 'TypeError: target.center is undefined'
2 parents b9d34ca + 18472f5 commit b90d7b2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/physics/arcade/World.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,8 +2023,8 @@ Phaser.Physics.Arcade.prototype = {
20232023
*/
20242024
angleBetweenCenters: function (source, target) {
20252025

2026-
var dx = target.center.x - source.center.x;
2027-
var dy = target.center.y - source.center.y;
2026+
var dx = target.centerX - source.centerX;
2027+
var dy = target.centerY - source.centerY;
20282028

20292029
return Math.atan2(dy, dx);
20302030

0 commit comments

Comments
 (0)