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

Hey cadviz, I’m sorry I didn’t get back to you sooner! Sometimes the notifications for thread subscriptions don’t seem to go through.

To answer your question, yes, iTween could be used for these operations, but honestly I’d just modify the Epic vehicle framework with a custom car model and let that take care of wheel rolling and turning. iTween would be a good choice to constrain the vehicle to a path, but the EVF already has logic to turn wheels while the vehicle is moving.

Hi ;
It is OK, and no need for sorrow, your reply was just in time… I’m glad you are still alive :slight_smile:
About the EVF you had mentioned… is it the Epic Vehicle system…?

Thanks for your time &
Have a nice day

I’m trying to move the position of my 3rd person camera boom to a new location using iTween. Whenever I play my scene and trigger my input, it stops at Cast to iTweenEvent. What am I missing? I’m running 4.7.4 with iTween Update 15.

Once I get that working I would also like to iTween the Target Arm Length as well. Is that possible?

Thanks

The plugin doesn’t work when I deploy on my phone (only tried launching); it gives me an error saying that the plugin could not be found. Any way to fix this?

Yes it is, sir. I recommend starting a new project using the vehicle game template then start messing with the controls and API.

Hey AdamZ,

The iTweenEvent object is the return value of the iTween call. The blue pin on the right of Actor Move From/To is the iTweenEvent. You don’t need to cast your Camera Boom as anything to tween it. However, a camera boom is SceneComponent, not an Actor, so you should use Component Move From/To instead of Actor Move From/To.

It would end up looking something like this:

I simplified the graph with a few Select nodes. Since you want the boom to move whether IsHolstered is true or false, we can just call one iTweenEvent for which the values change based on that boolean.

As for tweening the boom’s arm length, you can do that with a Float From/To node. In the future, tweening arm lengths directly will be supported, but it’s a while off. For now, you can do it with a float operation and an interface.

First, make sure your blueprint implements iTInterface. Click Class Settings:
Capture.

Then Add the iTInterface:
Capture.

Then you create your event. Pass the blueprint that implements the iTInterface into the “OnTweenUpdateTarget.” It will be called every frame that the tween updates. When it does, you can set the target arm length to the tween’s value. In this case, the target will be “self” since the blueprint that implements the interface and the blueprint that calls the tween is the same blueprint.

You call it, then search for “Event On Tween Update.” The screenshot shows “Event On Tween Data Tick” because I’m using a project with an older version of the plugin installed. I haven’t updated that project yet. On the Update Event node, you’ll see a pin that’s a Data Type struct called “DataTypeValues.” Right-click on it to split the struct pin so you can get the “float value” inside.

The switch is optional; it’s there so you can do different things if multiple tweens are calling the Update event at once. It checks the name of the tween then does something unique based on the name.

Interesting issue! Could you send me a screenshot? What’s producing the error? Unreal Engine or your phone? Which phone is it, what OS is your computer? Are you using the plugin version of iTween or the installed source version? Which revision? Sorry to barrage you with questions, but the more information we have the better chance we have at finding the cause of the issue. Thank you!

The error literally says “Could not find plugin ‘iTween’”. The screen is fully black, and after tapping “OK” my game opens up normally (without any iTween behavior ). I believe it is Unreal Engine, I don’t really see why it would be the phone. I tried on two phones. I’m running Windows 8, and I’m using the plugin version (latest one).

Thank you!

Ok, I see what’s happening . It’s come to light recently that the plug-in version of iTween has cooking issues, as do many binary unreal plugins for now, unfortunately. This is why there’s a big red warning about using the plug-in version on the first page. I’ll have to put a warning in the installer when the user tries to install the plug-in version just to be sure. However, there are some things you can try.

First you can try launching the game using a version of the editor built from the source code. Download the code from github and build the engine, then cook the game again. Some people have had success with this when building with the plug-in version of iTween.

Alternatively you can uninstall the plug-in version and install the c++ version. You’ll still be able to use blueprints, business as usual, but you’ll have to build your game with the added c++ code. Keep in mind that in doing so, you won’t be able to cook for iPhone from Windows anymore. Code projects can only cook for ios from a mac computer. If you’re not building for iPhone or not using Windows, that’s not a concern :slight_smile: you’ll also need to replace your itween nodes in your project since the plug-in nodes and c+±based nodes are incompatible. I know, it’s a pain but it’s unavoidable.

Failing either of those, you can just wait for Epic to fix this plug-in problem. It’s been plaguing plugins creators forever and there’s finally hope on the horizon for 4.8, but no clear guarantee. This is part of the reason you don’t see c++ code plugins on the marketplace - issues still exist.

I’m sorry that this is happening to you. I’ll have to go a little further to make sure people know the ramifications of using the plug-in version of iTween so we can avoid anyone else getting stuck .

Thanks for the reply :slight_smile: I already knew about the warning, I just wanted to report it just in case. And I was launching, not packaging; the warning says that it doesn’t work with the shipping version. I was using a development version.

Hahaha it’s alright, my game won’t be done until quite a bit of time, I can wait for this issue to be fixed ^.^

Thanks!

I’m glad you’re in good spirits about it, heh. For all intents and purposes, cooking for launching and cooking for packaging are just about the same process, unless I’m mistaken. Perhaps this is a problem with the development version too? I’ll look deeper into it. Would you mind telling me what engine version and iTween version you’re using?

Thanks! Latest for both :3 I even re-downloaded iTween just in case :stuck_out_tongue:

Do you get this error?

Hey ,

The Arm Length zoom worked great, thanks! I’m still having trouble with the Component Move from/to though, I’ve been spending over an hour trying to get it to work correctly. From your screenshot, is the ‘Coordinate Space: Self’ similar to local space? Whats the purpose of the Select Node at the top, with false and true?

Howdy -
I’m starting to get my head wrapped around iTween, and can see how this is incredibly helpful. In the past, I have been using Matinee to move multiple objects along a path. With iTween is can have an object follow a spline, and avoid several of the pain points of Matinee. I’m hoping that you can answer a few questions about the plugin.

1- Can I setup iTween to have four of the same object follow each other around a spline?
2- Can a skeletal mesh follow spline. Thinking of something like a snake or even a train type connection of objects?
3- Can I add trigger points along the path to turn or rotate objects without effecting the tween?

Thanks for the plugin, and look forward to your answers when you have the time! Take care.

Hmm… It won’t let me install as a C++ user. It’s greyed out and says “uninstall”. BP user works fine. My project was originally blueprint but I ended up converting it to code; is there an issue with these? Or do I have to take some extra steps?

Hey everyone else, I apologize for not getting back to y’all sooner. I got the email for AdamZ while I was out and about and thought I’d remember to get back to him, but somehow got sidetracked and just never got around to it. Of course, you don’t receive more mail about a certain thread unless you check it, so I never saw the rest. My sincerest apologies y’all. Now onto the Q&A:

Coordinate Space: Self is local but to the object itself, not its parent’s space. If you move something 1 unit in positive X (X+), it’ll move differently depending on the space. In World, it will move 1 unit “North.” In Parent, it will move 1 unit in the parent’s forward vector. In Self, it will move one unit in the object’s forward vector.

A select node takes a set of variables, in this case Option 0 and Option 1 (false/true). It also takes a switching argument, such as an index integer, an enum, or in this case a boolean. Depending on what the switch argument is, the select node will return one of the variables fed into it. For example, say you have two vectors, VectorA and VectorB. VectorA is plugged into Option0 and VectorB is plugged into Option 1. You also have a boolean as your switching argument. If your boolean is true, it will return Option 1 (which is VectorB). If it’s false, it will return Option 0 (VectorA). This reflects the fact that a boolean can be 0 or 1 (false or true, respectively). This allows you to condense your blueprint workflows to a single line of execution that automatically gets the correct variables to feed into the iTween node (or any other node) instead of having to create multiple functions or lines of execution. More information : A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

Is there anything else that doesn’t make sense or isn’t working?

Hey Tkfore, I’m really glad that iTween is making your animation life easier. That’s why it was made :slight_smile: Let’s tackle your questions:

  1. You can put an event that calls an iTween operation on a blueprint of the object and fire them off one after another. For example, you have a platform you want to follow a spline. The best thing to do is to make the platform into a blueprint and on the blueprint create a custom event. The event would call the Actor Move To Spline operation. Then in another blueprint, get a reference to the platforms and call your custom events one after another in sequence.
  2. Right now a whole skeletal mesh (or blueprint components of the mesh) and follow a spline, but individual bones are not supported. This is definitely planned in the future. However, you can work around this by using dummy actors (with no rendered mesh) fired off in sequence (like mentioned above) and directly manipulate the bones of your snake mesh in its animation blueprint passing in the locations of these dummy actors. Bone support has no ETA right now just because my life is a busy, busy mess at the moment, but it will be coming sooner rather than later :slight_smile:
  3. Yes, you can transform tweening objects with no effect on the tween. If you’re only tweening translation, rotate/scale at will. If you’re only tweening rotation, translate/scale at will. Et cetera. If you are tweening translation and you want to add a translation offset, make sure you do it OnTweenUpdate to ensure it happens every frame AFTER the tween instead of fighting it. Same goes for rotation/scale. If you’re adding transforms of the same type on top of your tween, make sure you’re using the OnTweenUpdate interface messaging system.

This could be a number of things, but a screenshot always helps! :slight_smile:

The installer is meant to turn off the install button if it detects that you’ve already installed that way. If you’ve installed (manually or with the installer) the plugin version, it will only let you uninstall the plugin version. If you’ve installed the C++ version, you can only uninstall it. Of course, once you uninstall, the “Install” button becomes live again.

It just looks in your source/Plugins directory for an iTween folder, so if you need to you can manually uninstall that by just deleting the iTween folder in your project’s Source/Plugins folder. If you’re still having issues, try searching “iTween” in your project folder and just delete everything that comes up (unless it’s something you created with that name). Then you can try again. Does my rambling make sense? :confused:

In other iTween news,
The future is looking bright for plugins’ packaging issues. C++ plugins are going to be finally allowed on the marketplace very soon and will be restructured in such a way that won’t be so externally-dependent. There’s even some talk about allowing free content on the marketplace with the advent of plugin support, so iTween will be there. :slight_smile: Even if free doesn’t get any room on the marketplace, plugins will at least play nice with the engine’s cooker, so just sit tight everyone. More info in the 4.8 stream part deux: Twitch

Hey , I don’t know if my brain isn’t wired for blueprints since I’m an artist, but I still can’t get your screenshot working like in above… I’ve tried a ridiculous amount of time/hours trying to get the functionality you suggested with little avail. is a blueprint of a simple setup. I have two sockets on my skeleton; one called AllSocket (pelvis) and the other HeadSocket (head). I would like a smooth transition from one to the other. My simple setup works if I set it to World Coordinate Space. But obviously if I move my character it remembers the locations of the sockets before the movement began, which isn’t giving me the effect I need. Can you suggest another work-around if you have a moment? I really appreciate your help!

Also , is there a way to use the Event on Tween Update for a cameras field of view also? It seems that I can’t have 2 of those nodes, and when I try to connect off of the Target Arm Length, it sort of works but rotates the FOV 180 degrees. Thanks!

Thanks for your reply! :slight_smile: Yes, your rambling make sense. But rest assured I already took those steps. I’m sure there are no traces of iTween there, or even in the UE4 root folder. Does this only work if I build from source? I just added code to the project and generated the files, then opened it up in VS. Though I don’t think that’ll make any difference.

I have a question about using iTween for multiple splines: is there an equivalent of [FONT=Courier New]PutOnPath() in the Unreal blueprints version? Suppose I have two splines (A and B): I’d like iTween to be able to start at the beginning of A, move to the end of A, then continue at B and continue moving to the end of B. Thanks!

iTween’s operations are mostly meant to move from a designated starting point to a designated ending point. When you call a tween, you’re more or less locking those start and end values in. However you can change these values as the tween happens. I can’t promise it’ll look perfect, but you can try! are a few options to have a moving tween end target:

  1. If you drag out from the Return Value on a tween, you can get the properties of it, like its end target. Drag out and search for “VectorTo.” Every Tick, you can set vectorTo to be the current location of the head socket (if you’re coming from the pelvis socket, you can reverse them if you’re going the other way). This way the tween will automatically try to compensate its current position to better reflect the updated position. This may look the worst, but it’s an option. It also might look fine.
  2. You can have a spline component as a child of your character’s blueprint and have point A be the pelvis and point B b the head. Then you can use ActorMoveToSplinePoint nodes to transition. The splint points will always follow your character this way. If your head or pelvis move slightly because of animations, you can set the spline point locations to be the current locations of the sockets on Tick so they will follow more precisely. The tween will always follow the exact path of the spline, so you can be sure it will never look weird. There is some inherent overhead with setting the spline point locations every frame, so maybe using a Timer would be a better idea to update them every half-second or so.
  3. You can use ActorMoveUpdate. The -Update functions are meant to be used with moving targets. Unlike the other nodes, these must be called on Tick or a Timer. You can have a branch before the node that checks a boolean and the boolean can be something like “moveToSocket.” If you want to tween the object, set “moveToSocket” to true so the -Update node will be called and immediately after check to see if the object’s current location is nearly equal to the VectorTo plugged into the -Update function, and if so set “moveToSocket” to false. This is probably your worst option because it requires quite a bit of Ticking or very fast Timers and does not come with many of the options the other two come with, like EaseTypes.

Yes, you just have to design some differentiation. This is easy to do by giving your tween operations a unique name (“Tween Name”). Then from “Event On Tween Update” you can you can call a Switch on Name and plug “Tween Name” into “Selection.” This way whenever OnTweenUpdate is called you’ll be able to specify code paths for each name. Different tweens can execute different code based on their names.

Hey paragon, I’m sorry you’re experiencing difficulty! Without seeing your folder structure and everything it’s hard to say what exactly is going on, but let me ask a few clarifying questions:

  1. Is your project a code project? That is to say, did you start the project as a C+±ready project? If not, have you ever used the “File->Add Code To Project” option from within the engine?
  2. I don’t mean to insult your intelligence by asking this, but in the interest of having all the information, did you recompile your game binary using visual studio?

I hope to get this sorted with you :slight_smile:

Hello Infinite Zenith, let me see if I can help!

Because splines are built into UE4, iTween for UE4 doesn’t need necessarily to cover all of the pathing stuff that the Unity version needed to. PutOnPath() for instance can be achieved by calling SetActorLocation() passing in GetWorldLocationAtTime from the spline component. If your spline has a “Duration” of 1.0 (and all do by default) then you can just pass in a 0.0-1.0 percent range.

What you can do for your situation, if I understand it correctly (and please let me know if I don’t! :)) is call ActorMoveToSplinePoint() using spline A and use the EventOnTweenComplete interface message to call ActorMoveToSplinePoint() using spline B when the first tween ends. Does that make sense? I can expand more if you need it.