will-e 0 Posted May 20, 2015 Report Share Posted May 20, 2015 I think I have some trouble understanding the fundamentals of the animation system. Should I keyframe absolutely everything always, or is it enough that I keyframe what I need to be animated? I need to move my character with code, so I have a main group that I don't keyframe at all. If I do, the character will always snap back to the original position. But making keyframes to one of the movies will change it on all of them if they are not keyframed as well. I have a following character structure: character_mastercharacterupperBodyheadfrontArmtorsorearArmfrontLegrearLeg I have three animations: baseIdle, baseWalk and sleep. The first two the character is up wright, in the sleep animation the character is turned 90 degrees. I haven't placed any keyframes on character_master, as that I am controlling from code (move, scale and so on). For the sleep animation I placed a keyframe on the character group, which made it turn 90 degrees. If I then change back to baseIdle animation, that is turned 90 degrees as well. Also I see odd behaviour in the code if I keyframe the character groups (scaling and distorting), even when I don't manipulate that from code at all. I'm not sure if I make any sense. Quote Link to post Share on other sites
stauzs 26 Posted May 20, 2015 Report Share Posted May 20, 2015 hi, basically animation is an array of tweens - which interpolate between current and next keyframes attributes (x,y,alpha etc.).at the first frame and the last frame object's attributes will reset to match keyframe's data. if you don't have keyframe - you won't have tweens for particular spritehere is example where main object has been animated with animation and middle object is animated with codedemo: http://mightyeditor.mightyfingers.com/data/build/p2b0g/0/anim/index.htmlproject: http://mightyeditor.mightyfingers.com/#p2b0g/0 click on screen to change animations Quote Link to post Share on other sites
stauzs 26 Posted May 20, 2015 Report Share Posted May 20, 2015 I think I found potential problem:you need to stop previous animation before starting a new one - it's not happening automatically as there might be some cases when you would like to mix 2 animations or smthprobably we could make by default to stop previous movie and introduce new method - e.g. mix.. or even we could blend up.. need to think about it.. Quote Link to post Share on other sites
will-e 0 Posted May 20, 2015 Author Report Share Posted May 20, 2015 I think that all the movies should reference to the initial position that you started with when you placed the sprites to the stage. When I made the character, I put all the parts into groups so that I can control every bit and the higher in hierarchy part controls the lower ones as well. Now, if I rotate the second-to-root (not character_master, but character) on the sleep animation movie 90 degrees to make the character lay down and then switch back to my walkcycle, the character has rotated 90 degrees as well even when I haven't done anything to it. And the order I switch tabs between movies makes the difference as well: if I rotate and keyframe a group 90 degrees in the sleep movie, move to the other tab, the layer is rotated as well. I rotate that back to 0, delete the keyframe and switch between the tabs that don't have the keyframes, all is well. Once I go back to the sleep animation (that still is keyframed and rotated) and then back, all are rotated again. Quote Link to post Share on other sites
will-e 0 Posted May 21, 2015 Author Report Share Posted May 21, 2015 I got it working with a lot of keyframes at the beginning and the end of each animation, but there is still some minor scaling issues that are due to the bounds of the whole group I think (making a new animation to the same master group makes the group bounds bigger which then makes the percentage scale output different scale for the character). Quote Link to post Share on other sites
Recommended Posts
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.