Posted July 20, 201411 yr I was wondering how I use the addChild() method correctly so that my animations don't mess up.
July 20, 201411 yr I have an explanation of this in my entity animation tutorial: http://jabelarminecraft.blogspot.com/p/complex-entity-models-including.html I also give a recommendation on how you can use arrays (containing the part rotations) to manage complex animations. Short answer though is that whenever the parent part is rotated or moved, all the children (and children of the children, etc.) are moved with it. If you rotate or move the child, it is *relative* to the parent. So if the parent is rotated 90 degrees and you rotate the child 10, then the child will actually be rotated 100 degrees. This is a good thing because it means you don't have to do any trigonometry to keep all the children attached. For example, if you have an arm with a hand and the hand has fingers, you'd make the hand the child of the arm and the fingers the child of the hand. Then if you just move the arm you don't have to do anything to move the hand and fingers with it (they'll all stay connected), but if you decide to wiggle the fingers you can just rotate them. The only other important point is that if you render the parent it will render all the children. You should *not* render the children or it will create very weird duplication. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.