Hey Community,
I’ve created all of my animations and have utilized them via code while working with montages. Though something I wanted to do was to have the upper half of my animation play while the lower half operates independently with another set of animations.
I’ve followed these set of video tutorials from epic but they focus on blueprints. So I thought i’d look into the nodes they were using and well… found myself stuck. I’m not entirely sure to be honest where to even begin on this.
So any assistance would be greatly appreciated for new methods to be explored. Below is the code I use when calling different animations.
bool Idle_Bool = GetMesh()->AnimScriptInstance->Montage_IsPlaying(Idle_1);
bool Running_Bool = GetMesh()->AnimScriptInstance->Montage_IsPlaying(Running_1);
//Check to see if the montages are playing to make sure we don't overlap.
if (Idle_Bool == false || Running_Bool == false) // Add additional checks for more montages.
{
if (IsIdle == true && CheckStuff == false && CheckStuff2 == false) // We are currently idle.
{
// Play Montage Here
float Idle = PlayAnimMontage(Idle_1, 1.0f); // Play rate. Default is 1.0f
}
else if (IsIdle == false) // We are not idle.
{
if (IsRunning == true && Running_Bool == false) // We are running however.
{
float Run = PlayAnimMontage(Running_1, 1.0f); // Play rate. Default is 1.0f // Check rate conditionally.
}
if (IsRunningBackwards == true && Running_Bool == false)
{
float Run = PlayAnimMontage(Running_1, 0.5f);
}
//If IsWalking == true && Walking_Bool == false
}
}