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

Ok, so I’ve narrowed down the issue to be the spawning of iTAux - for some reason, some worlds do not like spawning them. My hypothesis is that Landscapes either have their own world or do not return the same world as the rest of the UObjects in a scene, so if it’s the first object returned in my world-getting iterator it returns something otherworldly. iTAux then gets spawned, but not to the Viewport’s world. Then nothing ends up happening and crashes pop up unexpectedly because the iTweenEvents don’t see iTAux in the same world OR they’re also getting spawned into some other world.

The -Update functions work because they don’t spawn anything and all of their logic lives in a static function. Other events must spawn something because they rely on internal timekeeping, whereas -Update functions get time information plugged into them via Tick or a Timer.

This is just a hypothesis, but it may have some truth to it. I can see that the iTAux exists, just not for the player to actually use. I’m working on an automatic fix, but this may be a short-term solution for you:
In your main window:
Go to Window->Developer Tools->Class Viewer

In the window that opens up, find “iTAux” and drag it into the viewport.

This will brute force an iTAux into your scene so the iterator will find it and won’t have to create another. Then all of your tweens should function.

Please let me know if this worked for you! In the meantime I’ll keep working on an automatic fix.

So I downloaded iTween at your suggestion on the Progress bar, I’m a little confused on how to use it though, I did the C++ install, compiled ect, in Blueprints I see there is a ‘Float from/to simple’ so I thought i try that, the start end and time seems obvious, but what I dont get is the targets. I can point an object as the target, but how do I tell it what property its going to update? at first I thought maybe there is an event I can bind to, but I don’t see it.

Hey , glad to see you!

iTween does not update specific properties on targets, it sends an interface message to that object. So in your case you’d want to implement iTInterface on your widget blueprint and set that as the OnTweenTick target. Then back in your widget blueprint, implement “Event On Tween Data Tick.” This will be fired every time the tween updates. One of the sends on the interface is “Float Value.” This is the current value of the float between your start and end floats, modulated by the tween. You can plug that value into your “Set Progress Bar Value” node, fired off every time “Event On Tween Data Tick” is called.

I used to have a video up for this, but I took it down because it wasn’t really relevant anymore in the new version. I plan to make a more current video very soon, I’m just ironing out some bugs and usability improvements first. Let me know if anything doesn’t make sense, I’ll do my best to explain it in detail!

That worked great! And now my progress bar is exactly how I wanted it, in no time at all! Thanks .

Boy do I love when this happens! Power to you, my friend!

Resolved, we hope! We have fixed the Landscape issue on our end, but please let us know if there are any more problems!

Download : Mediafire

For those interested in the technical aspect of the fix: Because iTween Events are called by a library of static functions, GetWorld() is not callable. As such, to spawn iTwenEvent actors, we needed to create a static function that gets the world called GetWorldLocal. Originally, we ran a UObject Iterator looking for AActor-typed UObjects that would then return GetWorld() called on the first AActor found in the scene. Sometimes this would return a landscape actor or landscape gizmo actor. For whatever reason, calling GetWorld() on those actors (and some others) wouldn’t return the correct world, so spawning into that world caused problems. Now the iterator looks for UGameViewportClient objects. This is the object that allows the user to see the game, so it must exist. On top of that, there can be only one and it returns the correct “world.” Now spawning will always work.

Changelog:
~New Features
-“fps” is now allowed in the “timerInterval” value for the parser. Now if a user puts “fps” in the parser, the timerInterval will be set to 1 divided by the numerical value. For example, “timerInterval = 30fps” will set the timerInterval to 1/30 or about 0.033. Leaving “fps” out will set timerInterval to the value directly.
-INSTALLER: Installer now saves log files if the option is on.
-INSTALLER: Installer now saves user preferences (Checkboxes checked, BP or C++ by default, last selected path)
-INSTALLER: Uninstall button added that will uninstall iTween from your project if you have the correct installation type selected and the installation is detected in your project. Note that this will not remove UMG and Slate includes from your project’s build manifest. This won’t cause any problems or noticeable disadvantages. It is NOT necessary to uninstall before installing a new version. Installing when a previous version exists will automatically uninstall the previous version for you.
~Bugfixes
-Fixed an issue in which Events would not call “SetTimerInterval” when created.
-Some users were experiencing crashes/non-functioning Events with Landscapes and in some other situations. This has been solved.

Known issues:
Known issues:
~ActorRotateFromTo
-Constraining pitch causes rotation jumping
~ActorScaleFromTo
-No spacialization options
~ActorMoveToSplinePoint
-No handling for “out of bounds” easetypes
~ComponentMoveToSplinePoint
-No handling for “out of bounds” easetypes
~ActorRotateToSplinePoint
-No handling for “out of bounds” easetypes
-RotateToPath does not respect initial rotation; will snap rotation so that up vector of actor aligns with up vector of world
~ComponentRotateToSplinePoint
-No handling for “out of bounds” easetypes
-RotateToPath does not respect initial rotation; will snap rotation so that up vector of component aligns with up vector of world

Hello,

Great fix! Works like a charm now.
Many tnx.

Greetz,

G

Hello ,

I’ve got a question about ‘continues’ looping.

Basicly i want an actor keep rotating around its given axes.

But i’m somewhat confused because on parameter LoopType i cant find something like a continous loop (or max loops)
Maybe i need to add itween interface and override loop event or something, but cant figure it out yet…

Could you help me a little bit?

P.s. I think it would be neat to have an extra enum (e.g. Custom Loops) on param ‘Loop Type’ and an additional integer where -1 would be inifinite looping and any other value sets the total loops. (like Number of loop sections in On Tween Loop).
So that way, we would only have to set up for example an ‘Actor Rotate from/to’ tween on onBeginPlay; where each next loop continous on the current rotation values.

Many tnx in advance,
Greetz,

G

Hello again gpvd, I’m not quite sure what you’re asking. You want your actor to continuously loop its rotation animation, correct?

There are three options for loops.
Once: The tween will not loop.
Back-and-forth (pingpong/backandforth): The tween will arrive at its destination then move back toward its starting position and repeat.
Rewind: The tween will keep playing over and over, start to finish.

If I understand you correctly, what you want to use is Rewind. For example, to have an actor continuously spin on its Yaw, set its yaw from to be 0 and its yaw to to be 359. Set LoopType to be Rewind. This way it will keep spinning forever until you stop it.

I like your idea about setting a max number of loops though. As it is right now, if a user wants to stop after a certain number of loops they must use a loop target and check to see if the desired number of loop sections is reached then manually stop the tween. Setting a maximum number before sounds like a better plan. I’ll add that to my to-do list and you should see it very soon!

Let me know if I misunderstood you!

Indeed the rewind option is what im aiming at. I was confused by the naming; i thought rewind meant play, go back to its initial settings and start again…
tnx for the explanation.

Well that is what rewind does. It snaps the tween back to its initial settings and plays again. Unless you thought it meant back-and-forth. It was difficult coming up with proper names for those, heh. I apologise for the confusion!

But with initial settings; (thats the confusing part for me), are the current actor location and rotation values also reset to their initial values?

Yes sir, the values you pass through when you fire the tween are saved locally to the tweening operator and do not change until you change them yourself. So if you pass through “get actor location” it will save the actor’s location at the time of the tween’s start. Rewind and ping-pong will use that value and will not grab the actor’s current location again unless you manually change the from value.

Ah, now i (finally ;-)) understand!
Tnx again.

De nada. Always feel free to ask for help!

Hey , just popping in. I am still using the earlier version all over the place in my project. Love this lib!

Hey , this is probably just from my lack of understanding…but I wanted to tween the movement of my camera. I create these scene components as points where I want to camera to be, then using itween, I say take the cameras current relative location (the camera is a component) and move it to this scene’s relative location…works fine the first time, but all the consecutive moves don’t, its as if it can’t move backwards or something else.

EDIT:

Already figured it out, needed to set it to ‘Parent’ space instead of ‘self’

Thanks, mxnko! That’s part of the reason iTween remains free - we think every game can employ it in some way, and we’re always ecstatic to see people enjoying it. Seriously, rock on!

I’m glad you got it figured out! This could also be done using the spline system, but there’s usually more than one way to do what you want. As long as you’re getting the results you want, we’re happy!

This of course highlights the fact that our library really needs more and better tutorials. Unfortunately, I’m the only person who knows iTween for UE4 in and out. The only other person who could help on a level of deeper understanding is Bob Berkebile, the creator of iTween for Unity3D. And even then, the Unreal iTween is written completely differently from the original, mostly because Unreal and Unity are very different engines with different needs and also because every function of iTween for UE4 is recreated from scratch, save for the EaseType equations.

Being the only person who really knows the library at this point, it’s hard to get tutorials out because I have a regular programming job at Sweet and we get paid based on commissions, contracts and paid releases. iTween is a free release, so we’re not seeing any money from that. We’re definitely not complaining, and I see people using iTween as its own reward, but I do need to feed my family so other stuff takes priority, sad to say. But I will do my best to find time to get more learning material posted on Youtube and the wiki and I have specific time set aside each week to revisit the library to fix bugs, add features and investigate/implement requests and I will always be available to answer questions. So keep the questions and requests rolling in!

Hello ,

I’ve got a question.
Right now i’ve set up 2 tweens on an actor ; 1 move itween with loop once & 1 rotate itween with loop rewind.
When the actor is destroyed, the move tween is destroyed also,
However the rotation tween stays alive.

How can i manually destroy the rotation tween?
Icould just search in the taux array and remove the reference, and then destroy the tween itself, but i don’t know if this is the correct way…

Coul you help me with this one?

Tnx in advance,
Greetz,

G

I’ve used iTween in Unity, but still wondering if UE4 does really need this.