Hi!
I am new to cocos2d, but otherwise an experienced programmer.
In my project, I currently have a player sprite, that has a child sprite, in the middle of the view. The player sprite is moving around.
I have another sprite, Indicator, that follows the child sprite. I do this by
Indicator->setPosition(player->convertToWorldSpace(child->getPosition()));
This works just fine - Except when I try to zoom towards the player, using
this->setScale(3)
Using this command, my Indicator sprite goes berserk, and somewhat “amplifies” the movements of the child sprite, when before setting the scale of the scene (zooming), it worked just fine, and stayed on target. Once more, the indicator sprite is the one, that should be following the child sprite using convertToWorldSpace
Is there another way to zoom the view, that would work with convertToWorldSpace? Is there someway I could combat this “amplification” of motion that is caused by convertToWorldSpace, when the scene is scaled (zoomed)?
Thank you!
Edit: https://streamable.com/2fx0c5
Here is a video, that shows before scaling the scene, and after scaling the scene.
Notice the small yellow cross. That is the sprite that is following the child object of the player using convertToWorldSpace.