Apply additive animation on specified bone/bones

Hello,

i was wondering how i would go about applying a additive animation only on a few specified bones. In this case i want to apply the animation only to one specified leg.

Im working on a foot lock system and got kind of stuck right here.

If anyone knows a way around this please let me know.

/Affepaffe

Hello,

This is a really well documented issue, so I’m guessing you lack the terminology to effectively find what you need… or you’re lazy.

I hope the former, because “lazy” and “programmer” are oxymorons.

Anyway:

I don’t recall if the video goes over it, but you can also look into creating your own Montage Slots so that only the translations you want for a specific hierarchy will affect your character.

You can also use the Level Sequencer (with a character rig) to add additive movement.

Well, mabye i didnt make myself clear. What im doing is not applying an additive animation via a montage instead in a state machine as a transition state going from walking to idle.

What i need is to apply this additive animation to 2 specified bones and not the rest of the body. The reason i cannot use layered blend per bone is because i would need to save the calculated pose and put it into the base pose in the layered blend.

Addressed here:

I think I’m having the same issue.

Thing is, you can’t use montages inside states.

I have a Idle/walk blendspace state, and I want to play anj animation sequence called “AimIn” when transitioning to the aiming idle walk BS state.

However, the AimIn sequence has animated legs, which I want to use if the character’s speed = 0, but not if it’s > 0. I’d have to switch between the sequence playing in full, or with a layered blend per bone. but in a state, I also can’t call some other pose from another state to put as base pose.

I don’t see how to do this in a state machine. ideas?

Hi, Fael,

Can you post images of your Animation Blueprint (ABP)? It’s been a while since I’ve worked in ABPs, so I’ve forgotten some of the nuances.

It might help me and/or someone else brainstorm with you.

1 Like

Sure thing!

This is my base state machine. an unarmed idle/walk/run blendspace, then a state holding a pistol down IWR BS, and another state holding rifle down IWR BS.

When you right click mouse button it activates the aiming function, and changes to the state accordingly to a pistol or rifle aiming posed Idle/Walk only (no run) blendspaces. with strafing, fwd, bwd, left, right, and 45Âş between those.

I wanted to play these Rifle / Pistol Aim In/Out transition animation sequences between the gun holding and gun aiming, and I tried adding the animations at those red boxes I drew, but the problem is that it’ll make the aim in/out transition animations play full body, which is unwanted when the character’s speed is greater than 0.

I couldn’t find a way, inside the transition states, to select the full animation or upper body only, based on character speed. also you can’t add montages inside the states, just sequences.

I tried many other things outside the states in the anim graph, but didn’t get anything working as intended.

One thing I’m trying now is calling a function in my animBP whenever I click or unclick the right mouse button for aiming, but that’s leading to another list of issues.

Currently it looks like this:

1 Like

Yeah, I think I better understand what you mean.

And if, what you mean, is what I am thinking, there is no simple solution (that I know of) that is possible. This is because unused bones are still zeroed out (they will read as “0” NOT “Null”) so they still have a value.

Very annoying.

You may want to look into the Animation Blueprints that Vigilante created for their fighter planes:

https://www.fab.com/listings/b110218e-ce8e-4078-90bc-9d878d958cfc

Below are screenshots of what it looks like, and what you may be getting yourself into:


To be clear, the reason I suggest this is because the default position of the landing gear is down, and there are three bone hierarchies that control that landing gear. You put one up with an animation, the other two stay down. The only way I was able to get all three up at the same time was by using the Animation Blueprint above.

It’s complicated because you have to MANIPULATE EVERY OTHER BONE IN REAL TIME.

1 Like

@fael097

Im not really following what you are doing, but it sounds like you need to use Animation Curves and actually change state or the animation playing based on the weapon being carried.

Instead of saying “additive this”, “additive that”
Just output the position of the bone as the x/y/z of the curve, then when that curve is present use it to drive the local bone position of the bone you want to drive with it.

I’d go with complete new values dropping the additive part, so that you don’t get confused and that you can just replace instead of doing additions/math.

1 Like

Just to be clear, I’m not the OP, I just found this thread and thought my issue could be similar to the OP.

I was just trying to animate specific bones without using a layered blend per bone node, since in state machines you can’t really do that.

trying to make it clearer, I have an “aim in” animation sequence. I want it to play only on the upper body when the character is moving, and the whole thing when character isn’t moving.

You would use montages for that because of the slot definition.

You can blend 2 animation states as well, but why bother? Particulalty when using a montage properly is the “best practice” way to address the situation you want addressed?

Unless by Aim In you mean an AimOffset - in which case, then, maybe, different state machines for it, depending on the weapon type you hold could turn out to be the better solution.

Realistically the problem is how you set up the whole situation via state machines.
Holding a weapon is really a montage that gets slotted on the upper body.

There are some creative ways to get around that, where you can make a state machine and blend it up a chain of bones, resuting in a final animation comprised of 2 different state machines.
But its against best practice - and clunky I may add.

Montages on the other hand offer you real control over any aspect of the upper body movements while preserving lower body state machines…

1 Like

Right, that’s one of the things I tried. I had it set up like this:

However, some problems occur, for example:

If the character is idle, and then a montage starts playing (it will be the full body slot montage, since speed = 0), but then the character suddenly starts moving, it’ll continue playing it full body, and the character will appear sliding as it’s moving:

Souds like your slot definition is incorrect or not set. Check the animbp, then make sure the montage is on the correct slot…
Also, order of operations on when you add the slot is important too.

1 Like

I don’t think so, it looks like it’s working as intended by design. It’s just an issue for me since this isn’t what I want.

Engine is just playing the full body slot animation, since the montage started playing when character wasn’t moving. Then, character suddenly starts moving, it won’t magically know it should play the upper body slot montage, starting at the same frame the previous montage stopped.

I could code this to work, but it would get incredibly convoluted. this is why I went the state machine way, it should be way easier to make it work for this specific case than montages, since the whole thing is dynamic, and not just isolated montages being played.

But I think I’ve figured out a way. Let me try it and I’ll post an update

Yeah, so I made a base state machine that goes from a weapon holding Idle/walk/run state, to a weapon aiming state, without an aim in / aim out transition between them:

and also made a transition state machine, with the aim in/out states included: (these aim in/out transitions are the full body animations, not just upper body)

Then I had to do some funky blending, I blended the transitions state machine with the base SM as upper body / lower body, which would result in a upper body only transition SM, and then blended it again with the full body transition SM, this time by bool, if the character is moving.

that worked fine (in theory), it would use the aim in/out legs animation if the character was stopped, and the locomotion legs if character was moving, and blend between those in real time as it started or stopped moving as the transitions were playing.

the problem is that when blending a state with itself, it was kinda breaking the regular IWR for some reason, exaggerating the animations as if it was being added on top of the other (it wasn’t.)

so I had to add another blend by bool to use just the base SM without the transitions, if the character was empty handed. that fixed everything that I could notice, so far at least. :slight_smile:

now I got a new, different problem with light hit react montages, but I guess I should open a new thread for that

Ok, but this all seems kinda over-the-top.

Can you please share your anim-graph montage slot definition / hookup information?

Regarding “it won’t magically know it should play the upper body slot montage, starting at the same frame the previous montage stopped.”
Actually, you aren’t far off - and I was totally missing that part.

Montages give you the power to easily do this since they offer a “current frame” value as output that would allow you to call in and start another montage at that same frame-time (note that it’s time, not a frame).

So more often than not - and make your own topic on it since it’s kinda Off Topic and specifically on the subject much more help can be provided - people who are developing (on this sorry excuse of an engine) bite the bullet and spend a few hours if not a few days building a custom Montage Wrapper function that is used specifically to extended the montage system in order to provide easily applicable transitions, curve reading, etc.

However -
What’s wrong with having the animation just be split?
Top stuff plays as montage on upper body so it’s constant, never interrupted.
Bottom stuff is a montage that automatically breaks to the regular animation when input is received (ex: stop montage on any directional input applied).

Wouldn’t that achieve the same end result with no extra bells / ABP complexity?