[Open Beta] Procedural On-the-Fly Animation in UE4: iTween!

Hey CraftedGaming, it’s pretty easy to explain in a screenshot:

The two most important parts are the OnTweenUpdateTarget and Parameters pins.

We’re basically setting up a delegate with no variables in the Event Graph. OnTweenUpdateTarget is the object which will receive the delegate (in this case, it’s this same blueprint) and in Parameters we tell it what function we want to call. It can be any function or event, but in this case I prefer an event right next to the original tween call.

“oufn” in Parameters is short for “OnUpdateFunctionName” which can also be used instead of “oufn”. If you’re using the “Full” version of the node rather than “Simple” there’s a bespoke pin for OnUpdateFunctionName so you don’t have to write it into Parameters.

The tween returns an actor that performs the operation that stays alive as long as the operation is ongoing. I created another custom event nearby with the same name specified beside “oufn”. I get the iTween actor and get DataTypeValues which is a struct containing all the different types of data you’d get from the various Data tweens, then I put the float value into a variable (that you could think of as representing your widget’s opacity).

So to recap:

  • The tween is called with an update target and an update function name.
  • The tween is executed by an iTween actor.
  • Every frame the actor calls the function named on the specified update target object.
  • This function gets the data from the iTween actor’s DataTypeValues struct and acts upon the float data.
1 Like