How to resume an animation just after make transition back to it?

Assuming in-place animation

OK so the problem is not with indexing the current animation state but when the state change is required when the game state changes. Typical the game state changes when an event occurs, a button is pressed, collision occurs, and a value is change that represents that change with in the code base.

What this means is the animation changes after the game state has changed so is always running behind and compounds player latency behaviour relative to state changes that has come before or after.

Linear thinking assumes that if you swing and hit an object followed by a bounce the animation is preformed as a point A to point B action so it’s also assumed that you would have to bounce around in the anim graph between animation takes.

The fundamental requirement is to first understand cause and effect and what you need is a fixed value as to the required state change and not so much what you see as a delayed response of an event that has already occurred and based on that value can transition to a number of different visual elements in a controlled manner with in the logic of progression.

Lets take your combat swing.

We first can assume, based on your description, that the swing is not linear from point A to point B and that other game state changes can and does occur with in the same action. We can also assume that over time the action states needs to scale say the swing follows through or miss or is even blocked by the other player. Far to complex to solve with in a state machine as it blending abilities is rather limited as well the use of arguments to enter and exit only adds to the latency problem. Long way of saying it’s to slow.

What we do know is we can create fixed values as to the true game state and using values as a token set the current animation to represent the visual component of the game state.

Just as an example considering you don’t want to use a montage.

What we would want to do is create a series of corrective states based on an unlimited number of actions that could occur which would work well using a blend space. A blend space is nothing more than an index that contains a number of different animations you can blend and switch to using the “token”.

The benefit since the the blend space can scale you just need to add the corrective animation that uses the event token to trigger it and since it’s data driven you can do anything you wish with the values with out having to worry about entry and exit arguments.

Just an idea

1 Like