Download

Blend Poses by Int not working correctly

Hi, I’m trying to play additive idle animations on my character, but for some reason it always chooses the first Blend Pose to play, even though the Idle Index is being set correctly. (Idle Index 0 = normal Idle state, then if the Idle Index doesn’t = 0 then it moves to the additive state, where an idle index of 1 - 1 = BP0, 2 - 1 = BP1)

I’ve printed the Idle Index and it always changes to the correct one, but for some reason it only ever plays the first one and I can’t figure out why, any help would be appreciated, thanks!

Did you print it from within the animBP?
the only thing i can think of is that 1-1 is 0 and 0-1 is invalid so plays 0…

I dont use blend by int much, but the last time I used it it worked fine. Granted it was several engine versions ago by now…

Test it with a Make Int and feeding in a straight value of 2.

Yeah I printed it in the AnimBP. In the character BP it sets the Idle Index to a random integer between 1 & 2 (Since 0 is default idle anim) if you don’t move for a certain amount of time, so if it chooses 1, it should take the 1, -1, making it 0 and should therefore play the first animation, then 2-1=1 so it should play the second.

Testing it with a Make Int with a value of 2 did the exact same thing, but feeding it a value of 3 made it play the second animation, so I have no idea why it needs to be 3 to work.

Just to make this even more confusing, changing the default value of IdleIndex inside the AnimBP and watching in the preview, 0 is default as usual, then 1 and any value above 1 returns the second one; Blend Pose 1, but even then when I click play it does what it used to and just plays the first animation.

Plugging in the IdleIndex straight into the Active Child Index just returns the first animation too, even without the -1.

Well, the random function should already be -1 from the max, so maybe that’s the issue.
You don’t necessarily have to -1 if the value is just from a random int.

As far as blend pose by int, check its settings. You should be able to configure the values that it responds to.
just because the lable says blend pose 0 doesn’t necessarily mean the number it responds to is 0…

With out seeing the event graph the math does not add up.

With just 2 blend poses the integer vale of “idle Index” requires a input value of 0-1. With a -1 added to the math then an input of 0 will = -1 which is truncated to 0 and if you want to switch to blend pose 1 then the input at 1 -1 will be set to 0 so the pose would never change. You could change it to -100 and the pose will still be 0. It works on the other end as well as to get to pose 1 the input would have to be 2 but anything over 2 will truncate back to 2 as there is no additional blend poses.

You can put watch this value on the the active child index and see the value change in real time. Best practice in this situation is to plug the “idle Index” directly into “Active Child Index” and do the math in the event graph.