Hi, i have a problem which i dont know which is smartest way to do it, can u please give me some opinion?
The scenario i have is i want to change the parent of a node to a new parent which have layout component, and i want create the animation of the change.
Example i have a “deck” node and a “player’s hand” node, and i want to deal the card to player. The player’s hand have grid layout. I want when dealing the card, it will move with animation to the player’s hand position.
-
If i do nothing but change the parent, the card will immediately move to the hand’s position.
-
If i use cc.animation, the layout disallow me to change the X position of the card because the hand layout is a horizontal one.
-
If i change the card prefab to make it have a “wrapper” inside and change the wrapper animation, i can see the wrapper can go anywhere i want. But if i do that, i have to calculate the position in world space and convert to node space. But because the hand is a horizontal grid layout, in frame 1 i change the parent and run the animation, in the next frame it will update it to the real position in hand’s layout.
So that’s the problem im facing, can u please help me how to do that ?
