Getting Object Position while using CCMoveTo

Getting Object Position while using CCMoveTo
0.0 0


I noticed that while the CCMoveTo action is being performed you cannot get the current position of the object.
Apart from dividing the CCMoveTo into smaller units is there a way to get the current position of the object.

Like when i do this,

CCMoveTo *moveAction = CCMoveTo::actionWithDuration(10,ccp(10,10)); this->runAction(moveAction);

And then in another Function that is called when the CCMoveTo isn’t complete.

CCPoint objectPosition = this->getPosition()

it gives the Position of the object when the CCMoveTo didn’t start.

So i ended up breaking the CCMoveTo into 10 CCMoveTo’s with 1.0 sec interval which are called with a CCRepeatForever to get the Position

Is there any other better way to do this??


did u find a solution
if so can u plz share it plz


I don’t remember having any problems with this.
If you take a look in CCMoveTo implementation it just calls setPosition, so you should be ok calling getPosition.


yeah it just gives the end position.
Wanted to get the position in-between when it moves to reach the end point
something like this

void Mushroom::movetoend(CCPoint Po,int factor)
CCPoint Mushroom::getmushroomposition
return p;
void Mushroom::update
p = mus~~>getPosition();

it always return only the end points