VoyVivika Posted September 16, 2020 Share Posted September 16, 2020 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. Quote Link to comment Share on other sites More sharing options...
Josh Posted September 16, 2020 Share Posted September 16, 2020 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. 1 Quote 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 More sharing options...
VoyVivika Posted September 16, 2020 Author Share Posted September 16, 2020 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. Quote Link to comment Share on other sites More sharing options...
Josh Posted September 16, 2020 Share Posted September 16, 2020 This command will retrieve the bone by name: https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_FindChild 1 Quote 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 More sharing options...
VoyVivika Posted September 16, 2020 Author Share Posted September 16, 2020 9 hours ago, Josh said: This command will retrieve the bone by name: https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_FindChild 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. if I change this to self.player the animation will play, but it won't from the bone Quote Link to comment Share on other sites More sharing options...
VoyVivika Posted September 25, 2020 Author Share Posted September 25, 2020 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). 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.