- Home /
Moving during jumping animation
So the case is that I have a 36 frames long jumping animation and the jump itself starts at frame 12, where my object raises along y axis.
1) What would be the most easiest way to move my object forward while it's in air(during frames 12-36)?
2) How is jumping with animation generally done in games? I don't think my way is the best one.
Answer by IJM · Nov 23, 2010 at 09:54 PM
2) Jumping animation is combination of animation and object movement. In every frame the center of the mesh should be on x0,y0,z0. and you shoud move the GameObjec on the y axis and not the mesh it self.
1) You can use transform.forward to get the direction vector and apply the force in that direcion. (you sould disable rotetion if you want a realistic jump)
Hmm yes. I should probably move the object in the jumping code.
I'm familar with transform.forward but how would I make it work only at frames 12-36? Is there a way to check which frame is going in the animation or should I somehow add like half a second in the begining where the character doesn't move, again somehow?
You need to make a jumping animation that will be able to loop while the player is in the air, and not vice versa.
Thanks. So let's say I have a bouncing animation followed by the loopable jump animation. How would I move my object just during the jump animation?
Figured out that I can start at wanted frame with animation["myanim"].time = ("total frame amount"/ x); But I'm still looking for a way to move my object just during the animation. Can't be that hard..
I recommend that you use Rigidbodys and AddForce, if you make your movement with physics your player will move in the air after running. (Becouse of the low friction) If you jump from the place, the player will stay on the place.
Your answer
Follow this Question
Related Questions
How To Lock Direction While Jumping? 1 Answer
Time Delay Animation 1 Answer
why will my jump animation only play on multi-jumps? 0 Answers
Sprite Animator (walker boys)- Jumping 0 Answers
RTS movement with walking animation. 1 Answer