Set animation time through blueprints?

Say I wanted to set an animations normalized time through a blueprint, like I want to set the current time of an animation at 0.5/1.0, how could I go about this? Ideally in a way that can be updated consistently?

Something like this?

Might be, if I were to set play rate to 0.0. But I’m unsure if this is a good thing to be updating continually, say every frame, which I may need to. Can the same thing be done through an anim blueprint? Or could I manually set the pose of a skeletal mesh by a time in an animation sequence?

Not really sure on what your use case is here, maybe you can eleborate why you need to change this value on tick and what your end goal/ use case is?

You can howeever create a sequence node with any animation and expose the starting position as a pin. Promote it to a variable and in the evnet graph update the value to what you want

Update value here, Update Animation will run on tick

The use case is for recreating the “anim interactables” in the VR game Half Life : Alyx. Basically there’s a spline between two points, and you need to get the closest point on this line to the vr motion controller. Then you divide it by the length of the spline, so you’ll know if you’re say 20% down the length of the spline. So now you can update the animation to be at whichever frame is at 20% of the animation.

So I want to avoid having the animation play out completely, it should pause on a specific frame until it’s allowed to update.

I had previously got this working in Unity back before I switched engines, but it was a much more straight forward matter. I would just have an animation that doesn’t play, but set its normal time through a script and apply it to the targeted mesh. I’d rather avoid constantly resetting an animation, and instead stop playing the animation completely, then update the frames manually.

I haven’t played with the animation blueprints enough to know for sure if there was a way to pause the animation and update the time through script, but it seems as though setting the play rate to 0.0, then updating the start position as you’ve shown would achieve the same effect

I’m not familair with VR stuff but I think you’ll have to setup an anim graph and use blend poses by bool or enum. These are typically used to essentailly cut an animation short and transition into different one, say for example if doing action X only play animation for the wrist bone.

This video looks to be about right

This is for hand posing, which is not what I was looking for. I know what this is and how it works, but the functionality extends beyond that. Basically the player movement should update the animation time. It shouldn’t just play normally, the user should dictate it.

Think of it like a video play head. When a video or other form of media is paused, you can take your mouse and drag it left to right to “scrub” through the media’s time. This is essentially the functionality I’m looking for and I think your previous reply with the animation blueprint would work how I imagine, as long as I set the play rate to 0.0

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.