Andy90 Posted June 24, 2024 Posted June 24, 2024 Hello i try the new animation hooks. Right now the hook get triggert all the time at the start. void ReloadWeaponHook(shared_ptr<Skeleton> skeleton, shared_ptr<Object> extra) { auto weaponComponent = extra->As<Weapon>(); if (weaponComponent != nullptr) { auto model = weaponComponent->GetEntity()->As<Model>(); weaponComponent->EndReload(); Print("Done"); } } bool Weapon::CreateHooks() { auto model = this->GetEntity()->As<Model>(); int position = model->FindAnimation("Armature|17 Reload"); if (position != -1) { int animationLength = model->CountAnimationFrames(position); model->skeleton->AddHook(position, animationLength, ReloadWeaponHook, this->As<Weapon>()); return true; } return false; } Done is getting writen after he starts the animation Quote
Andy90 Posted June 24, 2024 Author Posted June 24, 2024 int animationLength = model->CountAnimationFrames(position) -2; gives the actual last frame Quote
Solution Josh Posted July 18, 2024 Solution Posted July 18, 2024 Animation hooks system has been revised in 0.9.7. I believe this is solved. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
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.