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

Awesome, thanks!

Hi

I have a quick question about easing in iTween: is it possible to use easing while pausing and playing a tween? In my project, Iā€™ve got a camera moving along a spline iTween, and there might be times when I need to pause the camera while the tween hasnā€™t completed yet. Right now, I can hit a button to call ā€œpause tween by name nodeā€ to pause the animation, but the resulting pause is a bit sudden. Are there methods that can be used to apply an ease to slow down the iTween before pausing it? Thanks for your time!

Thereā€™s nothing built in to ease into and out of a pause, but what you can do as a workaround is instead of pausing immediately, you can slow the speed to a stop, then pause.

When you want to pause, you can instead call Float From/To and pass in the other tweenā€™s current time as from and a larger number as to, thus slowing it down. Using on Tween Update, you can set the time variable of the motion tween every frame until itā€™s slow enough to appear to be stopped and on tween complete for the float tween you can actually pause the motion tween. Then when you want to unpause, first unpause the motion tween then set another float tween in the opposite direction, making the time variable decrease back to its original value.

This is a bit of a convoluted solution, absolutely. It honestly just didnā€™t come to mind as something people might want to do. Iā€™ll look into the feasibility of adding this as a feature of itween pauses, resumes, and stops.

The workaround should do the trick for now. Thanks!

is this osx compatible? I only see an exe installer in the package. thanks

Hello SDRLabs, itween is osx compatible, it just has to be installed manually rather than through the installer. Just copy the plugin folder to the plugins folder in your project, if you have one. If not, you can create it.

Hi. Apologies if this is addressed earlier in the thread but iā€™ve found it difficult to search for specifics (or i just suck at it)
Two things:

  1. For some reason iTweenEvent.cpp takes forever to build, does anybody have any idea why? WAY longer than any other cpp file we have by nearly 10x. Sometimse taking up to 8-10 minutes just on that one CPP. What gives?

  2. Cost me a couple hours to figure it out, but I discovered that when you tween on ā€œlocalā€ (ie parent) space for a component, it doesnā€™t actually do that. Instead it translates an expected passed in location or rotation in relative space and converts it to target locations or rotations in world space. Meaning you canā€™t actually tween in relative space at all. I changed it locally to do what i needed it to, but Iā€™m not sure what the intent was. I donā€™t find it terribly useful, myself, to pass in relative space coordinates and have it tween in world space.

Thereā€™s also no relative space equivalents for spline based tweens, but i donā€™t know how easy/hard it is to solve that.

Hey RogueRocket,

  1. Yes, that source file is a pain when it comes to build time, but just why is a mystery to me, to be perfectly honest. When I have the time to get back to iTween (life and work have been pretty heavy lately) Iā€™ll start taking pieces out to test build times to isolate the issue and try to resolve it. Itā€™s strange because Iā€™ve written larger source files that donā€™t take nearly as long as iTweenEvent, so it theoretically should not. In the end, weā€™ll all learn something :slight_smile:
  2. It was designed that way because I found using the relativity functions built-in didnā€™t do what I personally expected. What did you do to change it? Iā€™d like to incorporate that into the plugin as another option for tweeners if you donā€™t mind :slight_smile: As for Spline-based tweens, what are you expecting in terms of relative-space coordinates? In my mind, your splineā€™s location is just that. There is only one location on the spline that you can be at any given time and the splineā€™s shape does not change based on its parentage, nor does it matter whether the actor on the spline is using world space or local space coordinates to get where it needs to go. If you have suggestions and are thinking outside of the box my mind often finds itself in, please feel free to share!

Xcode compile fix

Hey ,

First of all, awesome plugin - thanks so much!

Just thought Iā€™d post this since I assume nobody else is using a Mac to compile iTween, but Xcode seems to complain about there not being an implementation for STweenableWidget::OnTweenUpdate in iTInterface.cpp
Visual Studio compiles fine, so I guess nobody noticed.

Adding it in seems to work just fine. Have attached screenshot. Hope that helps.

Thanks again!

Geordie

Wow, this makes it so much easier to quickly mock up a few animations when designing levels, great job!

Hi everyone

Just wanted to report this warning in Xcode since UE4 upgraded to 4.9:-

/iTween/iTween.cpp:27:11: ā€˜bNoCollisionFailā€™ is deprecated: bNoCollisionFail is deprecated. Use SpawnCollisionHandlingOverride to override the actor classā€™s spawn collision handling setting. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.

Thanks

Does the installer for Windows work with Unreal 4.9?

Thanks Geordie, next time I get to iTween I will fix this oversight :slight_smile: I donā€™t have a mac to test on, so I may or may not patch it correctly. But Iā€™ll do my best :slight_smile: Please let me know when the time comes if it compiles on xcode. One of these days I need to pick up a cheap macbook.

Thank you! Iā€™m glad youā€™re getting some good use out of the thing! Thatā€™s why we did it :slight_smile: (And also because we needed it for our own projects)

Ah, thank you. New spawning rules. Iā€™ll have this fixed before 4.10.

Yes, sort of. If youā€™re installing the source, it should compile no problem, just some warnings about the deprecation you see above. If you install the blueprint-only plugin version, youā€™ll most likely get a message about the binary being out-of-date. You can just have it auto-recompile it and you should be fine. Otherwise, you can recompile it yourself using VS or xcode. Thereā€™s a video tutorial on compiling for a new version on our channel :slight_smile:

Greetings!

Iā€™ve got a lift powered by iTween, and triggered by an external button. A variable is set called LiftIsRunning when the button is triggered, and if it is, then the lift runs (i.e. iTween starts).

Now, what i want to achieve is for every time the lift goes up and down one time, the LiftIsRunning boolean to be checked again.

If itā€™s still positive, run the loop once again, if itā€™s not active, stop the lift running.

Iā€™ve attached my blueprint.

If I send the output from iTween back into the Branch on the left, I get an immediate infinite loop when I stand on the button to trigger the lift, and I have to crash out of UE4.

Am I missing something simple? Iā€™m using Max Loops set to 2 so the lift just goes up and down once.

's the lift BP

And heres the button BP

The button blueprint cycles through all lifts and only activates the one labelled, for example, with the number 1.

(i.e. button 1 activates all lifts labelled 1, button 2 activates all lifts labelled 2 etc)

Thanks!

Fixed it!

Can some one throw in quick example, on how to use tween in C++ with UMG Component? I also tried to expand my Slate button like so:

but this yelds error:

Maybe I do not neet to derive from STweenableWidget at all, to use it, say, with UMG UButton?

Hey stansdad, sorry to not get sooner but I am glad to see you worked it out!

Hi there RyuMaster,

That error is usually thrown because youā€™re not including the STweenableWidget class, or youā€™re using a version from which that class had been removed for compatibility reasons. The good news is that with UMG, you donā€™t have to use the Slate tweening stuff. You can call UMG RT tweening functions right from blueprint. Iā€™d recommend setting up your tween in blueprint and calling said tween via interface message from C++.

Iā€™ve got a quick question: Iā€™m now working on a system where we have multiple objects being animated by iTween, so that they can collide with each other. On collision, Iā€™d like to stop the tweening by object reference: letā€™s say we have object A moving to and colliding with object B. When A knows its collided with B, then the Blueprint in A tells it to stop tweening. It works just fine when thereā€™s only one instance of A and B, but the Unreal Editor seems to freeze up entirely if I have more than one instance (so if Iā€™ve got A1 moving to B1 and A2 moving to B2, when A1 reaches B1, the engine freezes). Iā€™m wondering if thereā€™s another way to stop tweens to prevent this from occurring. Thanks!

(Strangely enough, if I use Pause rather than stop, it works)

I am having this same issue, whenever I am trying to stop the iTween by event reference, it crashed.

Thanks,

can you do a tutorial on how to get iTweens to communicate with other tweens by chance? That will be great!