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
    Hmmmm, what version are you using? This might be something I messed up as this should be completely possible.
     
  2. theBrandonWu

    theBrandonWu

    Joined:
    Sep 3, 2009
    Posts:
    244
    Originally coded with 1.0 and then I upgraded to 2.0.37 and changed all the codes to be 2.0 compatible. :)
     
  3. pixelplacement1

    pixelplacement1

    Joined:
    Aug 19, 2009
    Posts:
    674
    Can you try updating to 2.0.44 and let me know if this is still occurring? http://code.google.com/p/itween/downloads/list
     
  4. theBrandonWu

    theBrandonWu

    Joined:
    Sep 3, 2009
    Posts:
    244
    Updated to 2.0.44 and still happening. Could it be possible that I've accidentally restricted to one tween per obj somehow?
     
  5. theBrandonWu

    theBrandonWu

    Joined:
    Sep 3, 2009
    Posts:
    244
    It seems to only happen when ScaleBy is used. I might have broken something in the transition from 1.0 to 2.0. I'll try to experiment a bit more and report back.

    Thanks again,
    Brandon
     
    Last edited: Apr 21, 2011
  6. theBrandonWu

    theBrandonWu

    Joined:
    Sep 3, 2009
    Posts:
    244
  7. hairyMug

    hairyMug

    Joined:
    Aug 2, 2010
    Posts:
    9
    Just installed the c# extension and it refers to an "iTween.Init" function which is not there.
    >> I did just update iTween...

    thanks!
     
  8. pixelplacement1

    pixelplacement1

    Joined:
    Aug 19, 2009
    Posts:
    674
    What version of iTween is in your project?
     
  9. hairyMug

    hairyMug

    Joined:
    Aug 2, 2010
    Posts:
    9
    Just found the latest version @ google code
    >>asset store was older...

    Looking good!
    Thanks!
    Walt

    >>I'm using it with playmaker
     
  10. trooper

    trooper

    Joined:
    Aug 21, 2009
    Posts:
    746
    Cheers for iTween, loving it. Don't know if this little helper is useful to anyone, made it to string MoveTo's together easily. Also modified the iTweenPath to have additional options such as easetype and time etc.

    How to use:

    Setup your iTweenPaths then call this function:

    Code (csharp):
    1. iTweenHelper.Instance.MultipleMoveTo(GameObject gameObjectToBeMoved, string[] arrayOfPathNames, GameObject gameObjectCallBackWhenDone, string methodCallBackWhenDone);
     

    Attached Files:

  11. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    thanks trooper!
     
  12. pixelplacement1

    pixelplacement1

    Joined:
    Aug 19, 2009
    Posts:
    674
    Hey! Something I should add to the "official" version?
     
  13. LuxUnity

    LuxUnity

    Joined:
    Sep 29, 2010
    Posts:
    716
    Hello!

    There is a way to link a itween path on a child, in order to move the path together the father?

    I'm using a path to scroll player and camera, and i want add another path to handle the movement of the enemies.
    For example: the enemy (children) enter from right top off screen, curve, and exit from left bottom of the screen, while camera (father) and player (children) move along another path.

    Actually, the child path don't follow the camera and so the movement happen out of the screen.


    P.s.
    Another idea: Is it possible move a node of the path with an itween code, in order to change dinamically the shape of the path?
     
    Last edited: Jun 20, 2011
  14. 3ddf

    3ddf

    Joined:
    Mar 18, 2010
    Posts:
    6
    Hi,

    Just wondering if there is a way to set the easytype on a RectUpdate? I've tried setting defaults but that doesn't seem to affect the tween in this case...

    Thanks for your work on iTween, it's a great tool :)

    Edd
     
  15. sultanwalid

    sultanwalid

    Joined:
    May 5, 2011
    Posts:
    29
    Hi there,

    Very nice Framework we really like it,

    We just had a big problem with Itween, it's easily hackable by Cheat Engine (Speed Hack)

    We tried 2 cases :
    Non Haked one
    Haked One
    Do you have a solution ??

    Here the original post :
    http://forum.unity3d.com/threads/94713-Unity3D-and-Cheat-Engine
     
    Last edited: Jun 28, 2011
  16. kaoz70

    kaoz70

    Joined:
    Aug 2, 2009
    Posts:
    5
    Im also having the same problem with the 2.0.44 (and some before) version of iTween, im using the folowing code:

    Code (csharp):
    1.  
    2. iTween.FadeTo(barraNoTracking, 1, 0.4);
    3.            
    4. iTween.ValueTo(barraNoTracking, {
    5.     "to" : 46,
    6.     "from" : 0,
    7.     "time": 0.5,
    8.     "onupdate" : "barraEscala",
    9.     "onupdatetarget": gameObject
    10. });
    11.  
    it only does the iTween.ValueTo() line.

    EDIT

    I decided to see up to what version of iTween this would still work, and it seems it functioning up to iTween v 2.0.10, from v 2.0.11 and up its not working.
     
    Last edited: Jun 28, 2011
  17. elliot

    elliot

    Joined:
    Jun 3, 2011
    Posts:
    4
    I got the "NullReferenceException: Object reference not set to an instance of an object
    iTween.LateUpdate ()" message when I run iTween provided samples in my Unity3D project.

    If I run the samples in a clean new unity3d project,it works fine.

    I cannot figure out what went wrong :(
     
  18. Fires

    Fires

    Joined:
    May 30, 2011
    Posts:
    5
    So how would I go about passing more than one argument with onCompleteParams. I guess one thing I could do is just pass an array to the function, and make an overloaded version of that function to handle the array. But is there an easier way of doing this?
     
    Last edited: Jul 31, 2011
  19. jeewanthasas

    jeewanthasas

    Joined:
    Sep 8, 2011
    Posts:
    13
    Hi,

    Is it possible to implement a controller in a game like Air traffic controller/ harbour Master - Mouse Dragged-Path following/ Touch -Dragged path following (NOT following the mouse pointer) using iTweens ???

    Thank you...

    Regards,
    Jeewanthasas
     
  20. Dot45

    Dot45

    Joined:
    Jan 27, 2010
    Posts:
    33
    I'm having trouble with texture when using iTween

    when using ScaleTo or ScaleFrom, the texture become black i don't know why

    I have scale GUI plane to make effect but it happen that the texture become black when scaled.
    as you can see in the picture this after using iTween.ScaleFrom(iceHead,ht); the texture become black, i don't know why. the ice bar sometimes get black too.


     
  21. shadowfork

    shadowfork

    Joined:
    Jan 8, 2010
    Posts:
    167
    Can I get a response to this question I posted last February? Still interested to run iTween when my game is paused. Thanks.
     
  22. Hoff

    Hoff

    Joined:
    Jun 20, 2010
    Posts:
    223
  23. IcyPeak

    IcyPeak

    Joined:
    Dec 1, 2009
    Posts:
    377
    I have a headscratcher with iTween that is driving me crazy trying to figure out for quite a few hours now...

    http://forum.unity3d.com/threads/10...agespline-(maybe-)-question-on-mesh-colliders

    Basically, I have iTween set to a gameObject (a gate) to move along a path once a trigger is hit on another object. The problem is, 7/10 or so of the time it will "judder" or "skip" down below the path and where the object started, for 1-2 frames, then animate normally along the path. Sometimes it animates properly, with no judder, having changed nothing but reloading the scene. The OnTriggerEnter function has a "used" count check to ensure the gate only tries to animate once (since it's meant to be a one-time use switch to open it).

    This has me baffled... I'm using the iTween Visual Editor along with the Native extension for C#. The position it moves down a bit to isn't even in anything (it goes down maybe 10 units, using it with RageSpline so 100:1 of normal scale) and then skips back to normal and plays. Apparrently even when playing normally it's going down a scrap first, despite the center point being aligned with the iTween path's start point visually (for some reason it's about 10 units higher than, and 20 units lower than, the actual Position of the gate's Transform, which I've yet to figure out as well).

    EDIT: I finally figured it out... answer in link, but basically having a RigidBody on the object to be animated was screwing things up with the physics time-step. Solution: remove the RigidBody from the object.
     
    Last edited: Oct 16, 2011
  24. jackpile

    jackpile

    Joined:
    Apr 13, 2011
    Posts:
    27
    I've been using iTween now for a few months and it's really terrific piece of work. However, I found a bug with MoveTo (I think). I'm using it in one case to move my camera around various scenes. I want the camera's forward direction to follow the path, so I set orienttopath=true. If I don't specify the "lookahead" parameter, the camera properly orients to the path. But if I specify "lookahead" and use "time" instead of "speed", the camera is not properly oriented. No value of lookahead seems to affect the camera orientation. But when I set it back to use "speed", the camera is properly oriented. Is this correct behavior or are other people noticing this?
     
  25. Paulo-Henrique025

    Paulo-Henrique025

    Joined:
    Dec 12, 2010
    Posts:
    230
    Hi guys, is there a way to use the example "Path Constrained Character" with enabled physics? It uses PutOnPath that literally transports the GameObject to some portion of the path, much like the Translate, ignoring all physics.
     
  26. jtrencsenyi

    jtrencsenyi

    Joined:
    Aug 4, 2010
    Posts:
    15
    Hey Guys! Does the latest version of iTween compatible with the Unity 3.5 Flash exporter? Thanks.
     
  27. gauthi24

    gauthi24

    Joined:
    Feb 4, 2012
    Posts:
    34
    Hi,

    I'm trying to move my object along a bezier curve using the following code:

    Code (csharp):
    1.  
    2.     iTween.moveToBezier(gameObject, {"bezier": [Vector3(0,0,-0.1), Vector3(-1.05, 0,-0.1), Vector3(-3.42, 0, -0.1), Vector3(-4.35, -0.2, -0.1), Vector3(-4.46, -1.2, -0.1), Vector3(-4.46, -5.85, -0.1)], "orientToPath":false, "time":2, "transition":"linear"});
    3.  
    However, I get an error upon play stating: MissingMethodException: Method not found: 'iTween.moveToBezier', etc...

    I'm using the newest version of iTween and unity (3.5), and my scripts are in JS. Is it something that I'm doing wrong, or an issue with Unity 3.5, or is the method not valid anymore?

    Hope someone can help with this!
    Thanks for your time!
     
  28. gauthi24

    gauthi24

    Joined:
    Feb 4, 2012
    Posts:
    34
    I have answered my own question... it does not exist any more. I am now using:

    Code (csharp):
    1. iTween.MoveTo(gameObject, iTween.Hash("path", [Vector3(0,0,-0.1), Vector3(-1.05, 0,-0.1), Vector3(-3.42, 0, -0.1), Vector3(-4.35, -0.2, -0.1), Vector3(-4.46, -1.2, -0.1), Vector3(-4.46, -5.85, -0.1)], "time", 2, "easetype", iTween.EaseType.easeInOutSine));
     
  29. _zeta

    _zeta

    Joined:
    Dec 24, 2011
    Posts:
    99
    i think it does animation using FixedUpdate which means it will work synced with timescale...
    dont think there is a way to bypass this...
     
  30. spotlightor

    spotlightor

    Joined:
    Jun 25, 2010
    Posts:
    15
    I encountered this problem too. iTween does everything well when "timescale = 0" if the "delay" is 0. If you tween with a delay, the delay time will be stretched by timescale(infinite when timescale = 0). I think the "delay" in iTween is not timescale-independent. Hope this can be fixed in the next version.
     
  31. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    513
    I think Bob's on leave :p But it would be nice to know of any updates in relation to 3.5 etc... Thanks! (or an alternative forum for iTween?)
     
  32. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    397
    Itween is taking up 50ms for me and I'm only using iTween.MoveBy on one object. Is there any way to make this preform better? Possibly by making it so the object isn't moved as frequently?
     
  33. dobadobz

    dobadobz

    Joined:
    Dec 27, 2011
    Posts:
    6
    Hi all i have a question and now i dont know why is this error:

    This is my code:

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class MenuItemControl : MonoBehaviour
    5. {
    6.     public void OnSelected(bool on)
    7.     {
    8.         if(on)
    9.         {
    10.             iTween.MoveTo(gameObject, null, null, -1, null, -1);
    11.         }
    12.         else
    13.         {
    14.             iTween.MoveTo(gameObject, null, null, 0, null, 0);
    15.         }
    16.     }
    17. }
    the error is: Assets/Plugins/MenuItemControl.cs(10,32): error CS1501: No overload for method `MoveTo' takes `6' arguments
    i change with moveTo but say me that no have this method. i dont know what want this program to fix it :(::( please help me
    Same problem have with other functions rorate scale and so on :(
     
  34. Deleted User

    Deleted User

    Guest

    Look at the MoveTo documentation - http://itween.pixelplacement.com/documentation.php - there are two versions of MoveTo, one that takes two arguments and one that takes three (and you can verify this in the source code). Check out the Getting Started page for examples, and you can pay a few dollars on that site for more extensive examples.
     
  35. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    i found an issue with itween LookAt. If I call it before it has finished with the rotation, and I set the rotation, it will not rotate correctly to the final rotation. This only happens with certain rotation combinations of rotation.

    e.g

    iTween.LookTo (some position)
    transform.rotation = some rotation
    iTween.LookTo (a new position) // it does not rotate to new LookTo

    This only happens on certain rotation combinations. If I do rotation slerp, it works fine.
     
  36. jkrassman

    jkrassman

    Joined:
    Dec 18, 2012
    Posts:
    20
    Hi all and this is my first attempt to C# and Untiy3D - and this is my first "programming "question here in the forums, so please be nice ;)

    I am having a scene and when the user interact with an object, I am trying to move my camera to this object. I also want to change the FOV of the camera. I have found some interesting stuff here in the forums but that doesn't help me understanding how I should be possible to both animate the FOV and movment of the camera at the same time?

    I am using a Hashtable and using the from and to params. But how should I be able to animate the movement of the camera?

    This is my code snippets I am using right now, and as you see, the FOV gets animated but I have no clue how I should animate the camera? Any ideas? I guess that my approach is totally wrong....The camera position is hardcoded here in the example of my code.

    Best regards, Joakim - Sweden

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5.  
    6.  
    7.  
    8. public class Select_Room : MonoBehaviour {
    9.    
    10.     //Set up the camera
    11.     private Camera mainCamera;
    12.    
    13.     Hashtable ht = new Hashtable();
    14.  
    15.     void Awake(){
    16.         ht.Add("x",gameObject.transform.position.x);
    17.         ht.Add("y",gameObject.transform.position.y);
    18.         ht.Add("z",gameObject.transform.position.z);
    19.         ht.Add("from",40);
    20.         ht.Add("to",20);
    21.         ht.Add("time",2);
    22.         ht.Add("onupdate","animateCamera");
    23.         ht.Add("easetype",iTween.EaseType.easeInQuad);
    24.         }
    25.  
    26.        
    27.     void Start(){
    28.        
    29.     }
    30.    
    31.    
    32.     // Subscribe to events
    33.     void OnEnable(){
    34.         EasyTouch.On_SimpleTap += On_SimpleTap;
    35.     }
    36.  
    37.     void OnDisable(){
    38.         UnsubscribeEvent();
    39.     }
    40.    
    41.     void OnDestroy(){
    42.         UnsubscribeEvent();
    43.     }
    44.    
    45.     void UnsubscribeEvent(){
    46.         EasyTouch.On_SimpleTap -= On_SimpleTap;
    47.     }
    48.    
    49.     void animateCamera(float newFieldOfView){
    50.         Camera.mainCamera.fieldOfView = newFieldOfView;
    51.         Camera.mainCamera.transform.position = new Vector3(gameObject.transform.position.x,gameObject.transform.position.y,gameObject.transform.position.z - 8);
    52.     }
    53.    
    54.     private void On_SimpleTap( Gesture gesture){
    55.        
    56.         // Verification that the action on the object
    57.         if (gesture.pickObject == gameObject){
    58.            
    59.             iTween.ValueTo(gameObject,ht);
    60.             gameObject.renderer.material.color = new Color( Random.Range(0.0f,1.0f),  Random.Range(0.0f,1.0f), Random.Range(0.0f,1.0f));
    61.         }
    62.     }
    63. }
    64.  
    65.  
     
  37. SARWAN

    SARWAN

    Joined:
    Oct 23, 2012
    Posts:
    11
    Anyone form this Group Converted the Dictionary from Hashtable in the iTween Plugin.

    reply the Converted script links or post the script. That ll be helpful.
     
  38. Rexcusei

    Rexcusei

    Joined:
    Jan 10, 2013
    Posts:
    9
    Cheers, that's a relief.
    From what I've seen so far, it looks like a fantastic update.
     
  39. Huffmann1

    Huffmann1

    Joined:
    Jan 29, 2013
    Posts:
    4
    Hello,

    Im having an issue with instantiated objects

    if(randNum<5){

    clone = Instantiate(enemy,currentPos,Quaternion.identity);

    iTween.FadeTo(clone,{"delay", 3, "time", .5, "alpha", 0, "onComplete", "Destroyer(clone)"});

    }


    The error Im getting :

    "NullReferenceException: Object reference not set to an instance of an object"

    But it clearly is set on an instance. Whats the hack??
     
  40. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    I just updated to the latest version of iTween and ran into a problem - "Script named "iTween.cs" exist in multiple locations".
    It seems you added a new directory "Plugins/iTween.cs" and now it is conflicting the iTween.cs at the root directory of iTween. I had a quick look and it seems they are different - one file with 7481 lines of code the other 7490 lines of code. So what's the difference? Can I delete one of them?

    BTW, I am still in Unity v3.5.7 so that might be a problem..
     
  41. Deleted User

    Deleted User

    Guest

    You can delete the old one (the one that's not in the Plugins directory). Placing it in Plugins makes it usable by JavaScript.
     
  42. davedev

    davedev

    Joined:
    Jan 12, 2009
    Posts:
    70
    I somehow now have two iTween packages available for loading when I start a new project. Is that normal? In my Unity/Asset Store/Pixelplacement folder I have:

    Scripting/iTween.unitypackage
    ScriptingAnimation/iTween.unitypackage

    Do I need to always install both when starting a project or can I delete one of them from my Asset Store folder?
     
  43. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    628
    Any body would help me with MoveUpdate and RotateUpdate etc acting wierd on HD 4000 card but OK on Nvidia, the issue is that the tine paramater that I pass onto the iTween Update function seems to be multiplied by some value (10 or 20) so the follow is too much slower in Intel HD than on Nvidia,but works fine with a "time" value of 0 which corroborates the multiplier theory.
    Unity says that the Intel HD 4000 in question is not HW accelerating thus failing to initialize but one I switch to Nvidia and build the player and ryn it on HD 4000 the wierd slowdown occurs, also on Android the effect is the same except the hypothetical multiplier is smaller hence a bit less slow tween.
    Lately I moved the MoveUpdate to a FixedUpdate loop which FIXED the issue! on both Intel card and Android.
    So whats up with iTweenUpdates on Update loop and Intel and Android, even though I found a solution I would like to understand more about the reason behind it.
    peace.
     
  44. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    628
    Anybody knows the difference between iTween.MoveUpdate in Update vs in FixedUpdate?
     
  45. Deleted User

    Deleted User

    Guest

    The Scripting Reference for FixedUpdate says you should use it whenever dealing with a Rigidbody.
     
  46. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    628
    I'm not using any rigidbody, the tween is just behaving differently on two distinct videocars/platforms and between Update and FixedUpdate, I'm willing to wager there is a bug concerning iTweens MoveUpdate and RotateUpdate when it comes to the time paramater, any similar incidents here?
     
  47. Sajid_farooq

    Sajid_farooq

    Joined:
    May 23, 2012
    Posts:
    238
    Just a heads-up that Visual Actions was tested to work flawlessly with iTween, providing a completely visual workflow for Unity. You can see the two tutorials:

    1) Basic

    2) Advanced

    and more details in the official thread.
     
  48. dyego_s

    dyego_s

    Joined:
    Mar 26, 2013
    Posts:
    24
    Hi!

    Can I use bezier with iTween?
     
  49. droido

    droido

    Joined:
    Jan 27, 2014
    Posts:
    9
    iTween is great! Trying to use it every time it's possible.
    And still there's quite a newbie question. is there a way to just fadeAndDestroy gameobject? with no additional callback method for each.

    or at least is it possible with iTween to transfer object link to destroy? so callback function would know what exact gameobject it's suppose to remove.

    update
    it looks like this can be done as easy as that

     
    Last edited: Apr 8, 2014
  50. grantvon

    grantvon

    Joined:
    May 12, 2014
    Posts:
    1
    Hi, I want to buy the examples provided by http://itween.pixelplacement.com/examples.php.
    Can anybody tell me how can I get those examples after paying. Send an email or provide a url to download them? Thank you.
    [grant von]