Jump to content

Play Two Animations at Once?


VoyVivika
 Share

Recommended Posts

I'm currently testing the waters with this Engine and I'm struggling with animation.

So I'm trying to build some sort of Third Person Shooter, and my idea is to have the arms and legs animated separately, so the arms play one animation, and the legs play another, so if the player isn't holding anything I can just play a running animation with the arms, or a holding weapon animation depending on the Weapon.

I also want to mention that I want certain bones to be unaffected by the animation. I'm using my model's head bone as a sort of origin for the camera to be offset from, if there's a way to do this that someone could tell me about I'd be greatly appreciative.

Link to comment
Share on other sites

Pick the bone in the hierarchy where you want the animation to start, and just call PlayAnimation() on that one:
https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_PlayAnimation

To control your model's head, remove animation frames from the model at that point in the hierarchy, if possible.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

47 minutes ago, Josh said:

Pick the bone in the hierarchy where you want the animation to start, and just call PlayAnimation() on that one:
https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_PlayAnimation

To control your model's head, remove animation frames from the model at that point in the hierarchy, if possible.

how exactly does one pick a bone in the hierarchy? I haven't found any form of function or documentation on how to get something from a hierarchy and my attempts at calling a play command on bones hasn't been working so I don't think I'm at all doing what I'm meant to.

Link to comment
Share on other sites

9 hours ago, Josh said:

image.thumb.png.db44aa68e527898a6c775a62aea3d236.png

Note: I got the FindEntity function from the following

I don't know why, but self won't return anything to do with the entity the script is running from (or should be running from), so I have to do FindEntity("player") which feels weird but it's the only way I got it to work.

image.png.1baaa5ba04ab047a215af60a3d14339b.png

image.png.e8953b15be9173ff02d070d99827bb9d.png

if I change this to self.player the animation will play, but it won't from the bone

Link to comment
Share on other sites

  • 2 weeks later...

After further investigation of my problem, I found that if I tell a bone to play an animation, it for some reason stops being animated all together. So let's say I do "PlayAnimation(1, 0.5, 100, 0)" on the neck bone, it just ceases to animate all together which allows me to do things like rotation on it. While this is sort of useful I imagine this isn't the intended effect (and that this is what the StopAnimation() function is for)

Either this is a bug in the current version (4.6 as far as I'm aware), or it's a bug in my project because I originally started it in the demo which is only running 4.3 (or at least says it's running 4.3).

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.

 Share

×
×
  • Create New...