AustinKellar Posted May 5, 2017 Share Posted May 5, 2017 So I found out how to angle a sprite towards the cursor using angleToPointer, but is there a way to make a sprite face either another sprite or a set of x,y coordinates? Link to comment Share on other sites More sharing options...
Andromedus Posted May 5, 2017 Share Posted May 5, 2017 Phaser may have a built-in method for this somewhere, but personally I would just use a bit of maths. Not tested but I think this should work: objectSprite.rotation = Math.atan2(targetSprite.y - objectSprite.y, targetSprite.x - objectSprtie.x); Link to comment Share on other sites More sharing options...
Recommended Posts