I have a Entity in AndEngine and when I move it, all child move together with it. Which is great. But, sometimes, I need to move it without moving its children. Is it even possible? And, if it is, how can I do so?
1 Answer
its not possible as you have it set up now. Children inherit the transform of their parents. You will have to do some extra work. Here are two suggestions:
Make it appear that they move separately, but applying an opposite transform to each child. For example if the parent translates 10 x, move each child -10 x. It will appear not to move.
Another approach, would be to construct your Entity groups differently, so that the current parent entity and its children were all siblings within a common EntityContainer parent. That way when you want to move them all, you move the parent, and when you want to move the one part, you move the one part.
-
1\$\begingroup\$ Sorry. I just saw it now. Thanks for the reply. I've used the first approach. \$\endgroup\$ Sep 23, 2014 at 14:03