unreal-engine4unrealscript

Using mouse position to control character animation


I would like to set up an animation for my character and have the progression through the animation be controlled by the mouse movement.

E.g. the character starts in a rest state - the first frame of the animation - as the mouse moves through the x axis, it plays the animation forward in a linear relationship with the movement of the mouse. If you stop, the animation halts at that point and if you move backwards, the animation is reversed. Like scrubbing in a video editor except instead of a vide, it's a character animation.

I'm guessing this is eminently doable but will it be relatively trivial to do within Blueprints or am I better off using C++?


Solution

  • SquidInker!

    I'm two years late here, but for the sake of Google posterity here is the Blueprint solution as of engine 4.17.0:

    In your Animation Blueprint, right-click on the node for the animation asset in question, and select "convert to single frame animation"

    Your node will now have an "explicit time" input pin, which you can parameterize as you like to scrub through your animation: