Relevant anim time not working when using blendspace player with blendspace as reference

Hi there,

I noticed that the relevant anim time remaining does not work if you have multiple animation states containing a blendspace player where the blendspace is chosen through a reference via a pin.

Steps to reproduce:

  1. Create an animgraph.
  2. Create an animation state.
  3. Drag a blendspace into the animation state and check “(As pin) Blend Space”.
  4. Uncheck the “Loop” flag.
  5. Connect the blendspace pin to a reference to a blendspace.
  6. Create a transition out of the animation state containing a “Get relevant anim time remaining == 0” transition rule.
  7. Create a copy of the animation state.
  8. In the copy of the animation state, connect the blendspace pin to a different blendspace reference.
  9. Repeat step 6.
  10. Create transition rules leading into the two animation states so that one path is chosen.

When running, the animation in the chosen path will play, but the “Get relevant anim time remaining” will never count down to zero.

It seems like the blendspace player that was created when originally dragging a blendspace into the animation state remembers the which blendspace was used when creating it. And when there are copies of the blendspace player in animation states that are not running, the relevant anim time remaining seems to get confused.

The workaround is to not copy blendspace players between animation states, and instead create new ones for each new state. But it took a while to figure out what was wrong.

Hey ,

I’m a little confused by the last couple steps. Can you show me a screenshot of your setup? I get having the two states with different blandspaces, but I’m confused by the “one path is chosen” bit.

Here is my setup where I go from the Idle state into one of four different states based on the situation. What I meant with one path is chosen was basically to set up the transition rules so that you go from idle (or whatever you want to transition from) into the anim state that has the copy of the blend space player with a new blend space connected to it.

Please let me know if I’m explaining this badly :).

Hey ,

Could you migrate your character to a standalone project and send it to me. I’d like to see everything for myself, including what you’re doing in your transitions.

Currently, in my project, transitions using GetRelevantAnimTimeRemaining work as expected when the “from” state uses a blendspace. So I’m a little confused why they aren’t working for you and would like to experiment.

You can attach it here, but if you want to keep it private you can PM me a download link on the forums. Please respond here after sending a PM, if you do.

Hey ,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

I’m not the original poster, but I think I’m seeing the same behaviour. The time remaining never counts down, and during simulation, in the Transition editing window the Get Relevant Anim Time Remaining node has a blendspace in parentheses after the name which is not the blendspace being used. The solution was to delete that node and re-add it, and the newly added one will have the correct blendspace enabled. I suspect the transition had been copy/pasted.

Hey Kylotan,

I can’t seem to reproduce an issue like that. Yours sounds marginally different from the OP though. If you do find a solid set of repro steps, please start a new thread.

yeah, its works

Hi Guys, I think I have a similar issue.
In my use case StartJump Is a state playing a blendspace.
Return value gets really big.
A bit of search in UE4 code leads me to this method

float FAnimInstanceProxy::GetRelevantAnimTimeRemaining(int32 MachineIndex, int32 StateIndex)

{
	if(FAnimNode_AssetPlayerBase* AssetPlayer = GetRelevantAssetPlayerFromState(MachineIndex, StateIndex))
	{
		if(AssetPlayer->GetAnimAsset())
		{
			return AssetPlayer->GetCurrentAssetLength() - AssetPlayer->GetCurrentAssetTimePlayRateAdjusted();
		}
	}

	return MAX_flt;
}

And it seems that Max_flt is the value I get.
Any idea how I could get proper value?

I have got exactly the same issue in 4.27. Issue was not tested in 4.26 by me, but in 4.25 everything was working fine.

If i use custom anim node based on FAnimNode_AssetPlayerBase then FAnimInstanceProxy::GetRelevantAssetPlayerFromState() fails on getting state info, otherwise FAnimNode_SequencePlayer which is based on FAnimNode_AssetPlayerBase is working fine.