Sorry but I don’t understood how works node position
I have a player and a enemy inside a layerGame and I cannot move enemy over a locator inside player… I tried this but not works
enemy.x = player.loc.x;
enemy.y = player.loc.y;
how is the correct mode to move enemy over loc? sorry for noob question
X and Y coordinates of nodes are relative to its parent.
So if player and enemy have different parents, this transformation with the convertTo methods is needed.
so, I use the parent node with convertToWorldSpaceAR and after I use convertToNodeSpaceAR with the parent destination? Is not e trouble if childA2 have other 2 parent before LayerGame?
Follow this link to know more about convertToNodeSpace and related functionalities. It explains the core principles of it in C++ engine, CC should also follow along.