cocos2d::Node::setPosition overriding in cocos2d-x
When overriding cocos2d::Node::setPosition , you have to override setPosition(float x, float y) instead of setPosition(const cocos2d::Vec2& pos) . That’s because of the existence of setPosition3D() which is used by cocos2d::MoveBy action. Inside the action’s update() function, cocos2d::Node::setPosition3D() is used and it calls the cocos2d::Node::setPosition(float x, float y) . Thus if you only override setPosition(const Vec2& pos) , you may wander why the override does not work.