xronn Posted March 18, 2014 Share Posted March 18, 2014 Hi, Using Phaser 1.1.3 I saw in the examples the following snippet of code -game.physics.moveToPointer(sprite, 400);Can I use this same method to make one sprite follow another sprite?E.g;game.physics.moveToSprite(sprite, sprite2, 400); Link to comment Share on other sites More sharing options...
xronn Posted March 19, 2014 Author Share Posted March 19, 2014 bump Link to comment Share on other sites More sharing options...
ctmartinez1992 Posted March 19, 2014 Share Posted March 19, 2014 I am not sure about this, but i think that this is what you are looking for, post something if this does not work.Btw, you have to put this in a update method.game.physics.moveToObject(displayObject, objectToFollow, speed, maxTime) Link to comment Share on other sites More sharing options...
xronn Posted March 22, 2014 Author Share Posted March 22, 2014 Hey thanks, that works but the max time parameter seems to be different, I think the max time is the speed and I don't see any effect on what the 3 parameter does :S Is there a max time parameter that would be very useful. Link to comment Share on other sites More sharing options...
Ahmad Ihsan Posted June 4, 2015 Share Posted June 4, 2015 i am also implementing the same functionality in my game......the problem arises at the point where the sprite following the other sprite is not touching the ground and its not stopping where it should when it reaches close to the sprite being followed and also when the path finishes.any help in this regard would be highly appreciated. Link to comment Share on other sites More sharing options...
Recommended Posts