dudeperfect Posted December 29, 2014 Share Posted December 29, 2014 I have this circle right now:And player is able to rotate the arrow. And when it stops, I want to measure the angle between arrow's head and that black horizontal line in the middle of the centre. Arrow has these properties:arrow = game.add.sprite(380, 300, 'arrow');arrow.anchor.setTo(0.5, 0.5);game.physics.enable(arrow, Phaser.Physics.ARCADE);arrow.body.maxAngular = 500;arrow.body.angularDrag = 50; This is the line in update method:reachMessage.setText('Angle: ' + game.physics.arcade.angleToXY(arrow, 380, 300)); The problem is, that it always shows 0. I guess this is because my arrow's anchor is 0.5, but I must set that cause I want to spin arrow from center. What I want to do is measure angle between arrow's head and XY. I tried to change arrow's anchor to 0.5, 0.1 before measuring angle, but it doesn't work. How can I achieve that?Thank you, for your help. Link to comment Share on other sites More sharing options...
dudeperfect Posted December 29, 2014 Author Share Posted December 29, 2014 PROBLEM SOLVED Link to comment Share on other sites More sharing options...
crouzilles Posted March 15, 2015 Share Posted March 15, 2015 PROBLEM SOLVEDNice of you to share, thanks a lot.Crouz Link to comment Share on other sites More sharing options...
Recommended Posts