I have a montage with a character’s fall animation. I use Motion Warping to move the character to the floor from some height. It moves the character too fast, falling from any height in a couple of frames.
I need it to work on various heights so I can’t just extend or change height in the animation itself.
Maybe there is some workaround that allows to stretch falling time?
Motion Warping stretches the root-motion translation to fit the warp window, so a short fall animation plus a large height means the character covers the whole distance in the same few frames. The fix is to change how long the montage takes, not the animation itself:
- Work out how long the fall should take from the height. For a free fall: FallTime = sqrt(2 * Height / Gravity) (Gravity ~980 cm/s^2, or use abs(GetGravityZ)). Clamp it to something sensible, e.g. 0.3 - 2.0 s.
- Get the length of the warped section: Get Montage Length (or the notify state’s duration if only part of the montage is warped).
- PlayRate = MontageLength / FallTime. Pass that into the Play Rate input of Play Anim Montage (or call Montage Set Play Rate after starting it). Motion Warping then fits the same translation into the longer time window, so the drop looks slower and scales with height.
- Update the warp target (Add or Update Warp Target from Location) before or right as the montage starts, and keep the warp target name identical to the one in the Motion Warping notify state.
If you only want the character to land at the right spot but let gravity handle the vertical part, select the Motion Warping notify state and set the root motion modifier to Skew Warp, with Ignore Z Axis ticked, then warp only XY / rotation. Z then comes from Character Movement (falling) and takes the natural time for any height.
If you prefer to do it inside the asset, newer versions also have a Time Stretch Curve on montages, but it’s a fixed curve, so the Play Rate approach above is better for variable heights.
Where should I put these calculations?
Put it in the Blueprint that starts the fall, immediately before Play Anim Montage. Not in the Anim Graph, and not inside the montage.
On the character (or in the ability, if this is GAS), when the fall begins:
- Height is the capsule location Z minus the floor Z. Get the floor from a downward trace, or from the warp target you are about to set.
- FallTime = sqrt(2 * Height / 980), then clamp it, for example to 0.3-2 seconds. If gravity is not the default, use the absolute value of Get Gravity Z instead of 980.
- MontageLength is the duration, at play rate 1, of the section that contains the motion-warping window. Use the montage length if the whole clip is the fall.
- PlayRate = MontageLength / FallTime.
- Add or Update Warp Target with the floor location first, then Play Anim Montage and feed PlayRate into the Play Rate pin. The warping window is in montage time, so the play rate stretches the warp as well as the animation.
If the height is only known after the montage has started, call Montage Set Play Rate once from that same Blueprint when you have the final height. Do not do it from an Anim Notify.
It is ChatGPT answer, am I right? ![]()
Normally that’s done with state machines because that way you cleanly control the falling state as an idle.
jump button > animation start to jump apex > idle looping state > jump landing
If you want to subvert the montage system to do similar stuff you need to build your own montage wrapper functions that allow you to control the montages better than the garbage the engine provides does.
Yes it’s trivial, it’s basically just a wrapper function. But if you don’t do it then you have no way to set timings, or toggle loop transitions.
That’s probably all you need to be able to re-create the same logic as a montage. The wrapper function will take care of calling the transitions if you build it properly.
As far as how to transition, when you do it with the montage you are on the game thread so you can check things like collisions that aren’t otherwise available to the animation bp.
It is theoretically WRONG (not best practice) to do this stuff in the montage because of performance - but the baseline is the fact that regardless of what is wrong or right you need to wait for the game thread to tell you to exit the looping state.
If you simply change a boolean to the animbp and exit the state that works and is best practice.
If you do the whole thing with montages it works, but it’s probably not going to replicate natively (from server to client). And there are other issues like the lack of animation fast path…
But it’s probably still worth doing?