I am trying to follow and unfollow sprite by using this->runAction(action) and this->stopAction(action)
this error thrown (but If i use run-stop actions out of schedule scope it works):
Exception thrown: read access violation.
action->**** was 0xDDDDDDDD.
virtual studio focused this file CCActionManager.cpp line 193 : action->startWithTarget(target);
function is void ActionManager::addAction(...)
my code:
in header:
cocos2d::Action * followTheSprite;
HelloWorld::init :
followTheSprite = Follow::create(sprite3, Rect(0, 0, 0, 0));
Director::getInstance()->getScheduler()->schedule([&](float dt){
// doesnt work here, but this line works out of schedule scope,
this->runAction(followTheSprite);
}, this, 1.5f, false, "schedulerKey");
I use schedule because I need to check sprite whether is stopped or not
Hi @tranthor thank you for valuable reply but I didnt fixed issue with your reply but it helped me to dig more different. here is my actual schedule, please check.