playMaker

Author Topic: How can I get the physics time to match my animation time?  (Read 1668 times)

G-Kaiser

  • Playmaker Newbie
  • *
  • Posts: 34
How can I get the physics time to match my animation time?
« on: January 23, 2015, 11:08:41 PM »
   

    I am making a 2d fighting game. I cannot get my animations to match up with the timing of the movement of the gameobject. For example, if I have a jump animation that is 24 frames and I am using 24 frames per second then my jump should last 1 second from the time of start up until the character lands. When I add force to the y-axis it cause the the gameobject to move up. But the time it takes for the object to move up and return to the ground may take more than the 1 second to complete. During this time the jump animation has played and the character has entered the idle animation which looks like the character goes into idle mid jump. Is there any way to make it so that if when the gameobject moves the animation will play and match the timing of the physics action?
     


wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: How can I get the physics time to match my animation time?
« Reply #1 on: January 24, 2015, 12:04:04 AM »
Could you loop the animation and when the player hits the ground then transition over to the next animation?

Just curious, why 24 frames per second?  That's film and no one films anymore.  They all shoot on 4K UHD at 60FPS.  Just curious as I went to film scholl myself.

G-Kaiser

  • Playmaker Newbie
  • *
  • Posts: 34
Re: How can I get the physics time to match my animation time?
« Reply #2 on: January 24, 2015, 01:06:36 AM »
The reason I am using 24 frames per second is because it requires less drawings. I am drawing the frames myself by hand. Anything above 15 frames per second and above will fool the human eye when it comes to fluidity in 2d animation.

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: How can I get the physics time to match my animation time?
« Reply #3 on: January 24, 2015, 03:35:13 AM »
I saw on the asset store a manipulator package that you can stretch out stuff.  I'd assume you could use it.  Looked pretty good.  You click on the 2D object and it stretches it out.  You then save the animation to play.  I forget the name but seems like you could have a collider set up so if it's still in the air you could just play the animation until the collider hits the ground.  There are several like that.

The demo I saw the guy took 1 pick and did a number of things to it, saved then and have a really good animation witout the frames.  He did this in 2d.  3D there is a plugin called skele which is pretty good.  hope this helps or gives you ideas.