Hey,
How do I handle animations correctly in C++?
I would like to do as much as possible in C++, so can anybody help me?
Hey,
How do I handle animations correctly in C++?
I would like to do as much as possible in C++, so can anybody help me?
Hello,
To play animations from C++ you can do the following:
if (CustomAnimation != NULL && CustomMesh != NULL)
{
UAnimInstance* AnimInstance = CustomMesh->GetAnimInstance();
if (AnimInstance != NULL)
{
AnimInstance->Montage_Play(CustomAnimation, 1.f);
}
}
Please, however, note that you also need to add FullBody slot to your animation Blueprint and make sure it is used in all necessary Anim Montages.
Hope this helped!
Good luck!