Jump to content

Best approach for combining two animations


Gugis
 Share

Recommended Posts

Lets say player avatar has two animations - walk and attack. Attack animation is animated in idle stance. That means if player attacks while walking  - legs stops moving and player just slides. My goal is to separate animations for upper and lower body parts. If player attacks while walking, only upper part of body should play attack animation and legs continue walking. When attack animations ends torso has to make smooth transition back to walk animation. Here's my try: http://www.babylonjs-playground.com/#SAUQTU

Click on canvas to start attack animation. As you can see it's not really smooth. What changes to code or animations itself I should make?

Link to comment
Share on other sites

Hiya G!  Nice lookin' wizard!

http://www.babylonjs-playground.com/#SAUQTU#4

I did some serious adjusting, but not really much.  :)  I put all funcs into loader onSuccess callback (de-anonymous'd them? *shrug*). 

I changed to SceneLoader.Append instead of ImportMesh.  I don't know why I changed it.  :)  No big deal, it doesn't matter.

I moved walk() and setControls() calls to bottom (generally, we define funcs first, and then call them after defining).

The change that got SOME improvement... was adding one frame to line 46.  Was 130, now 131.  When it was at 130, the attack() animation seemed to stop too early, and thus... cause a "jump" or "jerk" when walk() restarted.  Possibly, more experimenting needed, there.

Not sure.  I don't think I improved anything, much.  Perhaps a LITTLE better.  I will experiment more when I get time.  Others may have ideas, too.  I have some on-click console errors that I don't understand, yet.  I need to think about those.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...