Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

iTween animation framework for Unity ready for use!

Discussion in 'Scripting' started by pixelplacement1, Mar 24, 2010.

  1. pixelplacement1

    pixelplacement1

    Joined:
    Aug 19, 2009
    Posts:
    674
    Unity 3 is a little more bossy on it's image compression recommendations but, thankfully, regaining control is easy. In each image's inspector look for "Texture Type" and, in the case of my background images, try setting the type to "GUI".

    Hope that helps.
     
  2. hiphish

    hiphish

    Joined:
    Nov 13, 2010
    Posts:
    626
    Hi, I think I ran into a bug concerning parenting.

    Here is what I want: I have a 2D platformer with moving platforms. The platforms are animated just like in the moving platforms example I bought from pixelplacement. There is a simple enemy, a box, walking around on that platform. If I just place it onto the platform, it gets unsteady when the platforms sinks. I guess the platforms sinks and then shortly later the ox follows. The common solution is simply to make the bx a child of the plaform.

    And this is where things got even worse. Now the box won't follow the platforms at all. I made a short video:


    How do I know it is iTween related? If I turn of the iTween script, run the game, got to scene view and move around the plaform myself (while the game is still running), the box sticks to the plaform as if it was gueld to it (OK, it still moves left and right as supposed).
    Same thing goes for the horzontally moving platform. It can easily move off the plaform, but if I turn of iTween and move it by hand I can barely shake it off.


    I uploaded the project here:
    http://www.megaupload.com/?d=6ZRCYWX0
    There is some stuff stripped off from the original project, but the relevant part is still in there.
     
  3. tripod4unity

    tripod4unity

    Joined:
    Jan 4, 2011
    Posts:
    4
    Yeah, that did the trick. Thanks!
     
  4. pixelplacement1

    pixelplacement1

    Joined:
    Aug 19, 2009
    Posts:
    674
    I don't believe this is strictly caused by iTween. Have you tried increasing mass? Not using a RigidBody or turning off gravity on the object once it's parented? Tried using transform.translate or addforce?
     
  5. hiphish

    hiphish

    Joined:
    Nov 13, 2010
    Posts:
    626
    Increasing a mass does not make a body fall faster. Anyway, I just said "screw it all" and did the following:

    -Add a collider to the enemy that does nothing, but slow it down (horizontally) for some reason
    -Increase movement speed five times to counter the collider's slowing effect

    Now the bouncing is almost unnoticable. It's a messy workaround but it seems to work. I just don't get how adding a collider is supposed to change things. maybe someone can enlighten me. This is what the settings of the enemy are:


    It does have a child object, which is a non-kinematic rigidbody (no gravity) with a collider, which can only collide with another collider the player is carrying around. So this "sensor" should not be able to interact with anything in the world, should it?


    And this is what the platform looks like:


    It has a few childern, one is a trigger to make one-way platforms, two are triggers which mark the cliff, so the enemy will turn around and the last one is a trigger, which parents enemies when they enter the trigger and unparents them when they leave.
    Code (csharp):
    1.  
    2. function OnTriggerEnter (collider: Collider) {
    3.    
    4.     if(collider.gameObject.name != "Player"  collider.gameObject.GetComponent(WalkerAI))
    5.         collider.transform.parent = transform.parent;
    6. }
    7.  
    8. function OnTriggerExit (collider: Collider) {
    9.     if(!collider.gameObject.GetComponent(WalkerAI))
    10.         Debug.Log ("ping");;
    11.     if(collider.transform.parent == transform.parent  collider.gameObject.GetComponent(WalkerAI).familyGroupObject)
    12.         collider.transform.parent = collider.gameObject.GetComponent(WalkerAI).familyGroupObject;
    13. }
    14.  

    So I don't see anything fancy which would explain such odd behaviour. I mean, if it works I'm fine with it, but I just fear that a messy workaround, that relies on chance might cause trouble sometime in the future.
     
  6. pickledzebra

    pickledzebra

    Joined:
    Feb 25, 2010
    Posts:
    33
    ugh, I know this is a boneheaded question, but I can't quite see it. Similar to the questions I asked previously. In the pathexample, can the points (array of transforms) be created procedurally rather than with the editor? I can't seem to figure out quite how the number of points visited is set.
     
  7. pixelplacement1

    pixelplacement1

    Joined:
    Aug 19, 2009
    Posts:
    674
    Yes, all iTween.MoveTo with a "path" needs is either an array of Vector3s or Transforms. They can be passed in any way you need.

    Helpful?
     
  8. pickledzebra

    pickledzebra

    Joined:
    Feb 25, 2010
    Posts:
    33
    From the PathExample, I just don't see how the points are specified. Where is it set that there are 6 (in the example)? I can see how to set these parameters in the inspector, just not in the code. I'm blind.
     
  9. pixelplacement1

    pixelplacement1

    Joined:
    Aug 19, 2009
    Posts:
    674
    There should be a "points" gameobject in the hierarchy? Select that and you should see gizmos appear. Honestly the iTween Visual Path Editor will help you a ton with this: http://pixelplacement.com/2010/12/03/visual-editor-for-itween-motion-paths/
     
  10. kagura

    kagura

    Joined:
    Jan 3, 2011
    Posts:
    54
    How can I scale a Unity Button using iTween ?
     
  11. pixelplacement1

    pixelplacement1

    Joined:
    Aug 19, 2009
    Posts:
    674
  12. kagura

    kagura

    Joined:
    Jan 3, 2011
    Posts:
    54
    I saw it , but I don't know how to do that
     
  13. pixelplacement1

    pixelplacement1

    Joined:
    Aug 19, 2009
    Posts:
    674
    That's why I'm offering that example for sale so you can learn how to.
     
  14. Slem

    Slem

    Joined:
    Jan 28, 2009
    Posts:
    191
    First of all: Awesome work on this. It's a must in every project now.

    I'm having a little trouble with the camera fading features. I'm using the CameraFadeAdd() in Start and then immidiately call CameraFadeFrom(1, 1); This gives me the wanted effect, but when I stop the editor the GUItexture used is not destroyed and when I start editor again I get a NullReferenceException at line 6488 in iTween.

    NullReferenceException: Object reference not set to an instance of an object
    iTween.LateUpdate () (at Assets/Plugins/iTween.cs:6488)

    Must I destroy this gameobject holding the guitexture myself? And for each time I wish to fade in or out? I find it odd the guitexture stays in scene as it is made in runtime.

    EDIT: should mention that the script is on a camera so theres no confusion :)
     
    Last edited: Jan 24, 2011
  15. ian-g

    ian-g

    Joined:
    May 10, 2010
    Posts:
    32
    Can anyone tell me how I can get the percentage of path travelled? I'm using PutOnPath() from my main character who follows (roughly) a path. The character can then effectively turn on "autopilot" at which point he should follow the path exactly from that moment.

    I've attached a really basic image of what I mean. Its based on the PutOnPath() example. The red (jittery!) line is the path my character is going, whilst the proper white path is the "autopilot" CR Spline. Where the red line ends, I want to join the path and follow the path from that moment to the end.

    $path.png

    I thought the distance travelled would just be the distance travelled along the points on the spline / total length of spline, but it doesn't appear to be the case.

    Any ideas?
     
  16. Slem

    Slem

    Joined:
    Jan 28, 2009
    Posts:
    191
    I figured this out. You might've mentioned it in the docs, but it seems iTweens don't like to be created in Start(). I invoked the method after Start was finished et voila.
     
  17. pixelplacement1

    pixelplacement1

    Joined:
    Aug 19, 2009
    Posts:
    674
    iTweens work fine from Start() method calls. Not sure exactly why you were having issues but glad you figured it out.
     
  18. angel

    angel

    Joined:
    Nov 28, 2009
    Posts:
    32
    I would like to know this, too. How do you calculate from the point the object is in path so that you can get the path percentage?

     
  19. ian-g

    ian-g

    Joined:
    May 10, 2010
    Posts:
    32
    I still haven't been able to work out a percentage but I can join the path at any point and carry on from that moment. I've had to create a new function inside iTween to return each Vector3 as per the PathLength() function. I then use a KdTree to find the nearest point to where you are within the Vector3 array returned from my new method. I then MoveTo() that point and then rebuild the path from the next element from the original path.

    This works for me since my path is cyclic.
     
  20. angel

    angel

    Joined:
    Nov 28, 2009
    Posts:
    32
    Yeah, I have some objects that are movable by the player (that follows a path) but I want the objects to also follow the same path. It uses the rigidbody physics to move, but I need to convert the position to the right percentage so it can be on the correct point of the path.
     
  21. gvick2002

    gvick2002

    Joined:
    Feb 4, 2011
    Posts:
    1
    i purchased the putonpathexample, but the download is broken...
     
  22. pixelplacement1

    pixelplacement1

    Joined:
    Aug 19, 2009
    Posts:
    674
    I resent you a link.
     
  23. cyberone

    cyberone

    Joined:
    Dec 16, 2010
    Posts:
    3
    hey there :)

    Just wondering if there is a way to play two iTween animations on the same object at once...

    heres a simple version of what Im trying to do...

    I have 4 prefabs each with a different itween animation script on them.

    for example...

    Code (csharp):
    1. iTween.MoveBy(gameObject,{"y":0.25,"Time":1,"LoopType":"PingPong"});
    then I spawn between the four prefabs randomly but would like to add another iTween animation to the Instantiated prefab.
    Code (csharp):
    1.  
    2. var newMonster = Instantiate(spawnPrefab1,transform.position,Quaternion.identity);
    3. iTween.MoveBy(newMonster.gameObject,{"x":10,"Time":5,"EaseType":"linear"});
    I can only get one or the other animations to work...

    cheers.
    Cyb

    Is there a way to play them both at the same time...?
     
  24. cyberone

    cyberone

    Joined:
    Dec 16, 2010
    Posts:
    3
    figured it out....
    make an empty gameObject and put the spawned prefab into that...then make the second animation onto the parent...

    :)
     
  25. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Hi,

    I've noticed a slight imperfection in iTween. When a tween is executing, and you want to start another tween of the same sort, the second tween dowsn't apply. Is there something I missed?

    Here's the example. Click the left cube twice. If you do it fast (while the first tween is running), the second punch doesn't apply.

    In my opinion - the second punch should reset the first one. Or should be superposed to the first one. Perhaps there should be some RepeatingPolicy parameter or similar? Just the ideas...

    btw nice library ;)
     
  26. pixelplacement1

    pixelplacement1

    Joined:
    Aug 19, 2009
    Posts:
    674
    This was by design.

    iTween acts on the rule of "doesn't destroy duplicates". Many people were using iTween 1.0 in Update loops and I needed to find a way to maximize performance for them. Therefore if an object is running an iTween and you give it an exactly the same version it will be ignored. To combat this just use one of iTween's stop methods before you give the new one or add slightly random values to each new iTween.

    Also, if you are using repetitive punches make sure you reset the objects value before you add new ones otherwise the object will resolve to random locations as it uses the start value for where it should resolve to.
     
  27. RTJ

    RTJ

    Joined:
    Feb 10, 2011
    Posts:
    6
    Hi

    I was just wondering if it would be possible to change the speed of a unity animation base on the one of the methods like MoveTo. So for example, I have a character with a walking animation along a defined path. If I'm using linear easing I would keep the animation speed the same otherwise it would have it's speed increased/decreased.

    What I would probably want to do is at some point on the line, lets say halfway t = 0.5, how far would the object's position move using linear against what ever the current easing is. I'm not even sure if that sounds feasible as t would be given from the easing equation but maybe someone has a better idea?

    Thanks
     
  28. elvis75k

    elvis75k

    Joined:
    Feb 5, 2011
    Posts:
    24
    i'm not shure if this was discussed already:
    i have a capsule that follow a path and a camera; i will like to LookTo (follow) the capsule with the camera along his route. For testing purposes i'm using the itween visual editor and as i have the camera look at the capsule just for the 1st frame. How can i follow the whole travel (update every frame) with the camera?
    Thanks.
     
  29. shadowfork

    shadowfork

    Joined:
    Jan 8, 2010
    Posts:
    167
    I have this code:

    Code (csharp):
    1.     iTween.FadeTo(BG,{"alpha":.40,"time":.8,"delay":.1,"easetype":"easeoutcubic", "ignoretimescale":true});
    2.  
    But whenever I put the Time.timescale = 0, it slows down, or stops. It doesn't seem to ignore the time scale. Am I missing something here? I've set it to true like the documentation stated.

    Please show my the way. Thanks!
     
  30. Specal

    Specal

    Joined:
    May 25, 2009
    Posts:
    17
    Hi,

    Currently I'am working on a 3D GUI menu. The problem is I want to use iTween to animate this.
    So far I have an object that can be clicked on, which spawns another object(a 3D GUI button).
    I want it to translate this 3D Button out of e.g the x axes by 10 from the spawning point, which was clicked upon in the beginning.
    Code (csharp):
    1.  
    2. iTween.MoveTo(gameObject, {"x":10,"time":1,"isLocal":true});
    3.  
    I've read on the iTween site that you need to set it to local space. But when I do as the above code, it translate to world coordinate x: 10.

    What am I not doing correct?:)

    Best regards
    Specal
     
  31. pixelplacement1

    pixelplacement1

    Joined:
    Aug 19, 2009
    Posts:
    674
    Perhaps you are spawning your new instance at 0,0,0? If so it would be correct for iTween to place the object at 10,0,0. If this isn't what you expect look into iTween's MoveBy method.
     
  32. mfcas

    mfcas

    Joined:
    Mar 13, 2011
    Posts:
    1
    Hello, is it possible to ease from and to a certain value? In my case I'm moving object along the path, and I don't want it to ease out completely, but just a bit so it still moves after the object has left the path. Thanks in advance for any help.
     
  33. kwabbott

    kwabbott

    Joined:
    Jun 5, 2007
    Posts:
    151
    I'm having a couple of problems with iTween when I leave a scene I'm using it in, and go back to that scene.

    The two problems are:
    1) Camera fades do not run the second time around
    2) iTween paths give me the error "An element with the same key already exists in the directory".

    Makes me think I need to re-initialize iTween somehow. Is this possible?

    thanks

    Kevin
     
  34. dakka

    dakka

    Joined:
    Jun 25, 2010
    Posts:
    113
    Thanks for a great package.

    I am also using multiple scenes that can be selected or returned to via a SceneManager.

    It seems there is a conflict with repeat adding to the dictionary.

    My error is:
    ArgumentException: An element with the same key already exists in the dictionary.
    System.Collections.Generic.Dictionary`2[System.String,iTweenPath].Add (System.String key, .iTweenPath value)
    iTweenPath.OnEnable () (at Assets/PixelPlacement/iTweenPath/iTweenPath.cs:17)
     
  35. dakka

    dakka

    Joined:
    Jun 25, 2010
    Posts:
    113
    I managed to make this work for me, by modifying iTweenPath.cs

    Code (csharp):
    1.     void OnDestroy ()
    2.     {
    3.         if (paths.ContainsKey(pathName.ToLower())) {
    4.             paths.Remove(pathName.ToLower());
    5.         }
    6.     }
    7.  
    8.  
     
    Last edited: Mar 16, 2011
  36. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,086
    Hey Bob, I'm trying to shake a camera that is parented to a "camera container object", the container object has the MouseOrbit script from standard assets on it, but its still pausing movement on the camera whenever I shake the child camera. How can I shake a camera without messing up the camera script's functionality?
     
  37. hiphish

    hiphish

    Joined:
    Nov 13, 2010
    Posts:
    626
    Hi there. iTween is awesome! I wanted to have an enemy monkey in a 2D sidescrolling game climb up and down a vine, treetrunk, whatever. With iTween it was just a matter of one single line of code.

    But there is one tiny problem: i wanted to make the distance and speed of the monkey random. So here is my code:
    Code (csharp):
    1.  
    2. function Start(){
    3.     iTween.MoveAdd(gameObject, iTween.Hash("y", Random.Range(minClimbDistance, maxClimbDistance), "time", Random.Range(minClimbTime, maxClimbTime), "delay", Random.Range(0.5, 1), "easetype", iTween.EaseType.easeInOutSine, "looptype", iTween.LoopType.pingPong));
    4. }
    5.  
    Works pretty well, but the speed and distance are only randomized the first time this is called, and from then on the values stay the same until I restart the game.


    is there a way to make it random every time the animation loops?
     
  38. hiphish

    hiphish

    Joined:
    Nov 13, 2010
    Posts:
    626
    With a little tinkering I came up with this:

    Code (csharp):
    1.  
    2. function Start(){
    3.     Climb();
    4. }
    5.  
    6. function Climb(){
    7.     //on every call reverse the travel direction
    8.     climbDirection *= -1;
    9. [...]  
    10.     iTween.MoveAdd(gameObject, iTween.Hash("y", climbDirection * actualClimbDistance, "speed", Random.Range(minClimbSpeed, maxClimbSpeed), "delay", Random.Range(0.5, 1), "easetype", iTween.EaseType.easeInOutSine, "oncomplete", "Climb"));
    11. }
    12.  
    13.  
    (I left out some lines of code here to focus on the relevant part)

    This works quite well except for one thing: In order to save performance, the monkey (like any other enemy) is deactivated. If it gets deactivated while the iTween script has isRunning unchecked (by the end of the animation I guess) the animation will not play when the monkey gets reactivated.
    As far as i understand the Climb() function does not get called any more.

    Any suggestions?

    EDIT
    Ok, this seems to do the job, but I'll have to do a bit more testing.
    Code (csharp):
    1.  
    2. function OnEnable(){
    3.     if(GetComponent(iTween)){
    4.         if(!GetComponent(iTween).isRunning)
    5.         Destroy(GetComponent(iTween));
    6.         Climb();
    7.     }
    8. }
    9.  
    It looks if there is an iTween script, and if so, then it checks if the scipt is running, and if not, it destroys the script and starts the climbing process anew.
     
    Last edited: Mar 22, 2011
  39. ben.06feb

    ben.06feb

    Joined:
    Dec 8, 2010
    Posts:
    9
    use itween scripting in c#.....for thwt u should have iTween default script in c#

    void Start () {
    iTween.MoveTo(gameObject, iTween.Hash("x", 10, "time", 1, "isLocal", true));
    }
     
  40. theBrandonWu

    theBrandonWu

    Joined:
    Sep 3, 2009
    Posts:
    244
    iTween 1.0 to iTween 2.0. I accidentally upgraded iTween to 2.0 from 1.0 on a huge project, and now left with tons of error message and broken levels ... I knew the two weren't compatible, which was why I never upgraded. But now that the damage is done, I need to make sure I update my scripts so they are iTween 2.0 compatible. Not sure where to get started, is there a post on how to migrate to iTween 2.0? Or what are the major differences in terms of scripting it?

    Thanks!
     
  41. pixelplacement1

    pixelplacement1

    Joined:
    Aug 19, 2009
    Posts:
    674
    You have 2 options:

    Uncomment the bottom block of code in the current iTween which has helper methods to get you going or snag the previous version of iTween (all versions are still available from the google code repository): http://code.google.com/p/itween/downloads/detail?name=iTween_1_0_34_JS.zip
     
  42. theBrandonWu

    theBrandonWu

    Joined:
    Sep 3, 2009
    Posts:
    244
    @pixelplacement1
    Great thanks for the tip! It looks like most of the changes can be easily adjusted. It seems like the default for some have changed. ex. transition/easetype type or local/world space. It shouldn't be too difficult to figure out :) Thanks again!
     
  43. mcroswell

    mcroswell

    Joined:
    Jan 6, 2010
    Posts:
    79
    Kevin,

    I don't know if you solved your problem, but I was having strange problems calling an iTween method from within an IEnumerator yielded method (in C#) itself called from within an LateUpdate(). Everything worked just fine except I was getting a NullReferenceException. My problem, was that I incorrectly put an iTween.cs script in the scene, attached to my camera. I know. Dumb right? This extra, and very wrong step, caused the exceptions. Simply removing the iTween.cs from the scene (not the project of course!) solved the problem. Once, again, I don't know if this is your problem, but it might help anyone else who occasionally tries crazy things like I did.

    For anyone interested this is for the Towers of Hanoi problem (for fun!) showing how to do delayed-recursion in Unity under an Update(). Here's the working method that I called from my IEnumerator method:

    Code (csharp):
    1.  
    2.     void MoveDisc(int srcPost, int destPost)
    3.     {
    4.         int nSmallestDisc = findSmallestDiscAtPost(srcPost);
    5.         if (nSmallestDisc >= 0)
    6.         {
    7.             float postHeight = posts[0].transform.localScale.y * 2.5f;  
    8.             Vector3[] v = new Vector3[3];
    9.             v[0] = discs[nSmallestDisc].transform.position;
    10.             v[1] = v[0];
    11.             v[1].y = postHeight;
    12.             v[2] = v[1];
    13.             v[2].x = posts[destPost].transform.position.x;
    14.             iTween.MoveTo(discs[nSmallestDisc].gameObject, iTween.Hash("path", v, "time", delayInSecs, "easetype", "linear"));  
    15.         }
    16.     }
    17.  
    -Mike


     
  44. Slem

    Slem

    Joined:
    Jan 28, 2009
    Posts:
    191
    Hey, Bob!

    I'm having an issue and I see an issue has been created on your code.google.com page for this project.
    My problem is that the ValueTo function does not include the 'onupdateparams' on the 'onupdate' callbacks. Any ideas as to why this is?
     
  45. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,086
    Bob, I seem to have discovered that regardless of whether or not you parent a camera to a "container" type of object and put your camera follow script on the container and try to ShakePosition/ShakeRotation the camera, or even trying to shake a camera with a follow script directly, it seems it won't do anything if the follow script is setting its positions/rotations in LateUpdate().

    Is there any way around that?
     
  46. Deoxyz

    Deoxyz

    Joined:
    Dec 13, 2009
    Posts:
    38
    @pixelplacement1
    Is there a way to switch from one iTween path to another without sudden snap movements?

    Crash bandicoot for example: The camera follows a path and sometimes the road is split into 2 roads. Each road will have a different path for the camera. Is there a way to switch from one to the other without problems?

    Great iTween examples btw :) I bought 3 of them today.
    Thanks in advance.
     
  47. Deoxyz

    Deoxyz

    Joined:
    Dec 13, 2009
    Posts:
    38
    Hi pixelplacement,

    I also got this in my console just now, but nothing went wrong.
    I was just testing to go backwards. If I press the spacebar the player goes backwards and slowsdown till he stops. afterwards he goes forwards again, until I press the spacebar again.

    After pressing the spacebar a few times, I got this message. Just wanted to let you know this :)

    Message:
    IndexOutOfRangeException: Array index is out of range.
    iTween.Interp (UnityEngine.Vector3[] pts, Single t) (at Assets/Pixelplacement/iTween/iTween.cs:6681)
    iTween.PointOnPath (UnityEngine.Vector3[] path, Single percent) (at Assets/Pixelplacement/iTween/iTween.cs:5765)
    iTweenTest.FindFloorAndRotation () (at Assets/Scripts/Tests/iTweenTest.cs:67)
    iTweenTest.Update () (at Assets/Scripts/Tests/iTweenTest.cs:52)
     
  48. martintamare

    martintamare

    Joined:
    Apr 13, 2011
    Posts:
    1
    Hi all,

    first very nice work to pixelplacement, iTween is really great !
    I'm helping students to make a video game for the end of the year and we are stuck on a strange issue :

    When attaching a character controller along with an iTween on a rigidbody, the object seems to jump from position to position, and even stay randomly in strange position.

    When removing the character controller, everything work smoothly.

    We try several option but none seems to work. Right now, we are trying to create a copy without anything but an iTween and then move it ...

    If you have any idea, let us know !

    Regards,

    Anthony
     
  49. Daniel.S

    Daniel.S

    Joined:
    Mar 2, 2011
    Posts:
    1
    Hi,
    I'm wondering a kind of simple question, but one I can't think of a good answer for. Firstly, can a path be animated along backwards? And Secondly, if a path can be animated along backward, can it be done from the current position/percentage along the path?

    Any suggestions would be quite welcome.

    Cheers,
    Daniel
     
  50. theBrandonWu

    theBrandonWu

    Joined:
    Sep 3, 2009
    Posts:
    244
    Hi all,

    Is it possible to have multiple itween acting on an object at the same time? I used to be able to do this with iTween 1.0, but it doesn't seem to work with 2.0 anymore - new iTween action will replace the previous one before the previous one is done, instead of all taking place on the object at the same time. Am I doing this wrong?

    Code (csharp):
    1.  
    2. iTween.RotateBy(gameObject, {"y":6, "time":2});
    3. iTween.MoveBy(gameObject, {"y":3, "time":2, "EaseType":"spring"});
    4. iTween.ScaleBy(gameObject, {"x":10, "y":10, "z":10, "time":2});        
    5.