Animation Frame by Frame

Hi guys, I don’t really know how to get a consistent animation in a “pivot point” standpoint.I mean, my animation are drawn frame by frame, and ingame it seems like the frames are not aligned well…

But how can I have a consistent pivot point when the size of the caracter needs to change ? For exemple :
when my hero is jumping, his legs are getting closer to his body so the player is getting smaller. What can I do to avoid those weird movement between frames ?

Nobody ? :confused:

You can adjust the pivot point of a sprite in the sprite editor, is that what you mean?

I guess this is what it’s all about but is there any “commun workflow” about it ? Or should I just jerking around every pivot on every sprites/frame ?!

The thing is, when the player is passing from the last frame of an animation (in a spritesheet) to the first one of another animation (another spritesheet then) it’s really tricky to set the pivot point as there is no way (to my knowledge) to immediately see if the 2 sprites are gonna be aligned ! Isn’t it ?
But I guess there must be a trick I’m not aware of !

There’s no trick. You just pick some common point you can easily identify or estimate on your sprites. For example, if it’s a rabbit character, you pick his tail or the bottom of the white patch on his belly or whatever.

Or, better yet: design all your sprites in the same size frame, regardless of any extra unused space above or below them. Then carve up your sprite sheet as a grid. Now you can always put the pivot point at the same place (probably the bottom center of the grid cell), regardless of how he’s moving and compressing art-wise.

(Where it really gets interesting is in updating the colliders to suit this morphing image… see this article for several methods of dealing with that and other 2D animation issues.)

1 Like

Man this article was really interesting !
Unfortunately for me, I spent a lot of time digging into an almost fully “animator approach” : I just set an int animState by code and my transitions in the animations depends on the animState (and obviously the transitions tree)

However, I’m already using the animation tools to edit colliders by frame. But this is pretty tricky sometimes. Talking about that, I’ve got sometimes an issue : when getting out of an animation (let’s say running) and entering another one (idle) it seems like the character is slightly moving up or down. I don’t really know if this is about pivot point or box colliders (like the collider of the new animation appears to low and have to “get out of the ground collider”)…

Another thing about this article that hit me : using 2 colliders for your character seems cool but, don’t you have trouble with interactions ? I mean, like taking double damages when getting hit by a large weapon and stuff like that ??

Yes, if you’re using physics, then that’s quite likely it. (In my article I didn’t use Unity physics; it’s easy enough to do simple 2D physics yourself, until you start needing to handle things like collision response in a realistic way.)

No, combining multiple basic colliders is a common technique and doesn’t cause any problem; as long as they’re under the same same Rigidbody, they’re essentially combined into one object. See the “Compound Colliders” section of the Rigidbody manual page. You put your OnCollisionEnter or whatever methods on the object with the Rigidbody, and it will only be called once.

1 Like
  • Mmmh, the thing is, I’ve been working on a prototype for quiet a long time and I’m a little bit afraid of rebuilding the physics now ! But I guess I’m gonna get used to play around with this “collider/pivot point combo” !

  • compound colliders is really a cool feature, I’m such a noob not to used it before ^^(my prototype characters was so simple that I never needed “complex colliders”