Gugis Posted May 5, 2017 Share Posted May 5, 2017 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? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 7, 2017 Share Posted May 7, 2017 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. Quote Link to comment Share on other sites More sharing options...
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.