iTween animation framework for Unity ready for use!

Hey everybody!

Just wanted to let everyone know that I just finished the release of iTween for the community. I’m in the middle of getting the documentation and support page together but I couldn’t wait to share my work with everyone. This framework is very similar to the approach Tweener takes on the Flash side of things to make movement easy and I hope everyone finds the system approachable.

It’s free to use, so knock yourselves out and I hope it saves everyone tons of time and helps you at least unify (pun intended) your abilities between Flash and Unity.

Share all of your concerns, bugs, and feature requests here and on the support page (when the contact form is ready).

Here’s the site: iTween for Unity by Bob Berkebile (pixelplacement)

Hi,

Nice job. Congratulations.
I tried iTween on Unity Pro 2.6.1f3 on mac and windows : just perfect.

I tried iTween on Unity iPhone Advance 1.6.0f1, and this time, I had a lot of error messages like this :

Assets/Scripts/iTween.js(861,26): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 861)
Assets/Scripts/iTween.js(1085,26): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 1085)
Assets/Scripts/iTween.js(1276,26): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 1276)
Assets/Scripts/iTween.js(1473,26): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 1473)
Assets/Scripts/iTween.js(1616,26): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 1616)
Assets/Scripts/iTween.js(1640,34): BCE0051: Operator ‘’ cannot be used with a left hand side of type ‘int’ and a right hand side of type ‘Object’. (Filename: Assets/Scripts/iTween.js Line: 1640)
Assets/Scripts/iTween.js(1640,74): BCE0051: Operator '
’ cannot be used with a left hand side of type ‘int’ and a right hand side of type ‘Object’. (Filename: Assets/Scripts/iTween.js Line: 1640)
Assets/Scripts/iTween.js(1640,115): BCE0051: Operator ‘’ cannot be used with a left hand side of type ‘int’ and a right hand side of type ‘Object’. (Filename: Assets/Scripts/iTween.js Line: 1640)
Assets/Scripts/iTween.js(1753,26): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 1753)
Assets/Scripts/iTween.js(791,26): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 791)
Assets/Scripts/iTween.js(819,29): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 819)
Assets/Scripts/iTween.js(821,35): BCE0051: Operator ‘<’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 821)
Assets/Scripts/iTween.js(822,56): BCE0004: Ambiguous reference ‘Abs’: UnityEngine.Mathf.Abs(int), UnityEngine.Mathf.Abs(float). (Filename: Assets/Scripts/iTween.js Line: 822)
Assets/Scripts/iTween.js(822,40): BCE0050: Operator ‘-’ cannot be used with an expression of type ‘error’. (Filename: Assets/Scripts/iTween.js Line: 822)
Assets/Scripts/iTween.js(824,29): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 824)
Assets/Scripts/iTween.js(826,35): BCE0051: Operator ‘<’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 826)
Assets/Scripts/iTween.js(827,56): BCE0004: Ambiguous reference ‘Abs’: UnityEngine.Mathf.Abs(int), UnityEngine.Mathf.Abs(float). (Filename: Assets/Scripts/iTween.js Line: 827)
Assets/Scripts/iTween.js(827,40): BCE0050: Operator ‘-’ cannot be used with an expression of type ‘error’. (Filename: Assets/Scripts/iTween.js Line: 827)
Assets/Scripts/iTween.js(829,29): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 829)
Assets/Scripts/iTween.js(831,35): BCE0051: Operator ‘<’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 831)
Assets/Scripts/iTween.js(832,56): BCE0004: Ambiguous reference ‘Abs’: UnityEngine.Mathf.Abs(int), UnityEngine.Mathf.Abs(float). (Filename: Assets/Scripts/iTween.js Line: 832)
Assets/Scripts/iTween.js(832,40): BCE0050: Operator ‘-’ cannot be used with an expression of type ‘error’. (Filename: Assets/Scripts/iTween.js Line: 832)
Assets/Scripts/iTween.js(718,26): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 718)
Assets/Scripts/iTween.js(735,26): BCE0051: Operator '
’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 735)
Assets/Scripts/iTween.js(741,26): BCE0051: Operator ‘’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 741)
Assets/Scripts/iTween.js(747,26): BCE0051: Operator '
’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 747)
Assets/Scripts/iTween.js(755,29): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 755)
Assets/Scripts/iTween.js(757,35): BCE0051: Operator ‘<’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 757)
Assets/Scripts/iTween.js(758,50): BCE0004: Ambiguous reference ‘Abs’: UnityEngine.Mathf.Abs(int), UnityEngine.Mathf.Abs(float). (Filename: Assets/Scripts/iTween.js Line: 758)
Assets/Scripts/iTween.js(758,34): BCE0050: Operator ‘-’ cannot be used with an expression of type ‘error’. (Filename: Assets/Scripts/iTween.js Line: 758)
Assets/Scripts/iTween.js(760,29): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 760)
Assets/Scripts/iTween.js(762,35): BCE0051: Operator ‘<’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 762)
Assets/Scripts/iTween.js(763,50): BCE0004: Ambiguous reference ‘Abs’: UnityEngine.Mathf.Abs(int), UnityEngine.Mathf.Abs(float). (Filename: Assets/Scripts/iTween.js Line: 763)
Assets/Scripts/iTween.js(763,34): BCE0050: Operator ‘-’ cannot be used with an expression of type ‘error’. (Filename: Assets/Scripts/iTween.js Line: 763)
Assets/Scripts/iTween.js(765,29): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 765)
Assets/Scripts/iTween.js(767,35): BCE0051: Operator ‘<’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 767)
Assets/Scripts/iTween.js(768,50): BCE0004: Ambiguous reference ‘Abs’: UnityEngine.Mathf.Abs(int), UnityEngine.Mathf.Abs(float). (Filename: Assets/Scripts/iTween.js Line: 768)
Assets/Scripts/iTween.js(768,34): BCE0050: Operator ‘-’ cannot be used with an expression of type ‘error’. (Filename: Assets/Scripts/iTween.js Line: 768)
Assets/Scripts/iTween.js(645,26): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 645)
Assets/Scripts/iTween.js(686,46): BCE0051: Operator ‘’ cannot be used with a left hand side of type ‘float’ and a right hand side of type ‘Object’. (Filename: Assets/Scripts/iTween.js Line: 686)
Assets/Scripts/iTween.js(687,46): BCE0051: Operator '
’ cannot be used with a left hand side of type ‘float’ and a right hand side of type ‘Object’. (Filename: Assets/Scripts/iTween.js Line: 687)
Assets/Scripts/iTween.js(688,46): BCE0051: Operator ‘*’ cannot be used with a left hand side of type ‘float’ and a right hand side of type ‘Object’. (Filename: Assets/Scripts/iTween.js Line: 688)
Assets/Scripts/iTween.js(449,26): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 449)
Assets/Scripts/iTween.js(614,26): BCE0051: Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘int’. (Filename: Assets/Scripts/iTween.js Line: 614)

I really want to use your iTween on my iPhone project.
I hope you can fixe it.

Best regards

Ok, thanks for taking a look at things. I’ve been up 'till 3:00 every night this week so it’s no surprise there’s a bug here or there. Let me dig into it and I’ll let you know!

Thanks a ton for bringing those errors to my attention. Version 1.0.2 is now online and ready for use and all of those issues are corrected!

Are you planning on a c# version at all? If not does the license allow for me converting to c# myself?
Thanks for a very nice clean system.
Chris

Very nice… this might help with my casual game that I’m working on…

Also would like a C# version but for now can use the current one.

I’d like to avoid fracturing off into two versions at this point. But… forgive my stupidity but can’t you just use this version with both javascript and C#? If not if someone wants to take the lead on that conversion and I’ll add it to the download page that would be great. I just worry about maintaining two different versions. Thoughts?

Wow, this looks great! Thanks for sharing. :smile:

Also, to everyone wanting a C# port. There is a version underway from my friend Pat and I’ll let you know when it’s ready for prime time! I’d like to have he and I on this project only just so we can keep things unified until all of the quirks are worked out!

Good news, Ill stop my conversion effort :slight_smile:

Yeah, take it easy… we got you covered!

Just as a heads up I’ll probably be able to get the C# version online by the middle of next week but there may be a few bugs in it so I’d love to get you guys testing on it as soon as it’s ready. Also, a few bugs were found here and there (minimal) with the JavaScript version but they have been fixed and the newest version is online. In addition, I’ve also put together a “getting started” video tutorial to help people get rolling with the system.

Thanks!

Thank you so much for sharing! Could you help me with the looping aspect of iTween? Say I have this code:

function Start () {
iTween.punchPosition(gameObject,{“y”:10,“time”:4,“transition”:“linear”});
}

What would be the easiest way to have it continuously loop?

Hello, i have a problem with the “fadeTo” method. The tween work one time when i want an alpha to 0. But when i put a fadeTo 100 (after the first tween), there is not tween, the color.a go to 100 without transition and this all time.
Can you help me please

édit : sorry that’s working,i forgot than opacity go from 0 to 1.

Hi,

Your iTween is very usefull, but would it be possible to add a “moveToward” and “rotateToward” functions ?

So the gameObject moves and rotates toward an other object ?

I need it so much.

thx anyway, very good work.

PARADOKS

New JavaScript version is available (1.0.5) with a lot of fixes.

C# version is ready!! Go grab it: http://www.pixelplacement.com/iTween/

melissaNCSU:
To loop that punch I would put your tween in a function and then call that with your callback:

P.S. the “punch” methods do not use a “transition”.

executeTween();

function executeTween(){
	iTween.punchPosition(gameObject,{"y":10,"time":4, "onComplete":"executeTween"}); 
}

krys64:
Try this:

iTween.fadeTo(gameObject,{"alpha":0,"time":4});
iTween.fadeTo(gameObject,{"alpha":1,"time":4,"delay":4});

PARADOKS:
Not sure I’ll have time for those additions but you could always grab a transform of a “target” GO and just use those values in your moveTo command.

Thanks, i forgot than opacity is différent in unity.
For fadeto method,can you script for use it on a gameobject with a lot of materials ? I am trying to modify your class but i am not a very good developer :slight_smile:

How do I use the javascript version in my C# project?

I’ve googled a bit and apparently I have to put iTween.js in one of the folders that compile before the script I want to use it from so I placed iTween.js in “Standard Assets”, but I still get:

The type or namespace name 'iTween' could not be found (are you missing a using directive or an assembly reference?)

The reason I do not use the C# version is that it seems a bit crippled in usability as you have to specify every argument compared to just the ones you need. Surely there’s an equivalent to hashtables in C#? :slight_smile:

The documentation of the C# version is really awesome though. :slight_smile:

Hey can you use the script for Camera?
I used the Move script on the camera but it doesn’t do anything.

krys64:
Nope, only on the base material. Sorry, but this is free and we have a lot going on in our lives but if you need something custom maybe we can lend a hand.

Thomas GD:
Yes, take a look at the “Hello World: Complex” :slight_smile:

TwiiK:
If you are using C#, you would have to use hashtables and construct the code as follows:

HashTable ht = new HashTable();
ht.Add(“time”, 1);
ht.Add(“delay”, 1.5f);
ht.Add(“x”, 2);
ht.Add(“y”, 1.5f);

iTween.moveTo(gameObject, ht);

This really isn’t better than the current implementation we used for C#, but we can certainly add that functionality. However, until Unity supports the newest version of Mono, which apparently won’t happen until at least Unity 3.0, that is what you would be stuck with if you want to call it from C#. The way it would work in c# 3.0, which the newest
version of Mono supports (read: not until Unity 3.0) would be:

iTween.moveTo(gameObject, new HashTable(){{“time”, 1}, {“delay”, 1.5f},
{“x”, 2}, {“y”, 1.5f}});

In the meantime, if you want to use the C# version and call it from C#, you
can use an overload. For instance, the following calls are identical:

iTween.moveTo(gameObject, 1, 1.5f, 2, 1.5f, null);
iTween.moveTo(gameObject, 1, 1.5f, 2, 1.5f, null, null);
iTween.moveTo(gameObject, 1, 1.5f, 2, 1.5f, null, null, null, null);

This, I might note, is shorter than if you were to use the HashTable.