Download

How to get Animation Playtime for setup transitionrules correctly

Well i just want a simple transition between my InAir State and a possible Roll_after_Fall State.
So i thought it would be simple to take the Duration of the InAir Animation in Seconds and just check its more than 2 or 3 seconds…

Well i tried out just abit and ended with this:

well but it doesnt work and i dont know how i could handle this in another kind :man_shrugging:

I would do like this:
create a bool doRoll , InAir default to false
then from your blendspace blueprint:
during Is Falling, set InAir to true.
during Is Moving on Ground, set doRoll to true if InAir is true, then add a delay 0.1s to set doRoll and InAir to false.

is falling and is moving on ground is obtained from get movement component.

Well this is what im doin right now:

I want that rolling is only happening if a specific amount of time has passed in the same animation so the game knows that the player is falling “from a higher place” .

If the player is just doin a simple jump the transition to roll shouldnt happen.
thats exactly what i want ^^

well from your blendpsace/character blueprint:
Is Falling, timer >2s, set InAirRoll true something like that.
Doubt it a good idea to use timer in animgraph, better do it in the blendspace blueprint and set the bool there.

ah k thx now its pretty clear for me ^^ im doin it in C++ right now thx :slight_smile:

1 Like

it just an idea how to count down using sequence+delay, you will have to find a way to not loop the delay.

That how i implemented my double tap w to sprint, counting the time btw release and press w to trigger sprint.

First of.
You should never do anything in transition rules.
No And, not Or, and definitely not any math or variable pulling that isn’t direct.

Doing so disables fastpath. And generally means there’s better ways.

For this particular objective, the “right” way to do it is to read up the already existing FindFloor result and get its distance.
Yes OnTick because you need to know the value.
You are only “reading”, the line trace is already happening results are already collected so the performance impact is minimal.
Simply.
If IsFalling, read the result. Pull out the distance.

You can also instantiate a timer to count off how many frames the character spends in air, or MS. Or wharves kind of timer you prefer.

You can also override the OnStateChanged of the movement component to fire off different events that set up your variables.

If you want a “bad” blueprint approach that’s probably better than most.

It’s over a year old, so I’d never approach it the same way now.
But it’s a start.

How would you fix it for fastpath?
Well, any RelevantTimeRemaining should be changed up to use the automatic transition checkbox.

The character BP would have to do the and/or and set boolean or an Int.
Fastpath May be able to == since it can do != but test it. Don’t count on it.

If you have a boolean you also need to toggle it off after use. So put a delay of maybe .2 after you toggle it in anim BP and reset it to false.

This is easy on the CPP side. More complex on the BP side.