Search Unity

HOTween: a fast and powerful Unity tween engine

Discussion in 'Assets and Asset Store' started by Demigiant, Jan 7, 2012.

  1. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Nah, I just got used to the Maya way of having the list of items on the left side - and I gotta keep those two columns next to each other to be able to drag-and-drop easily ^_^

    I'll pass your hints to Sandro. BTW, I was getting a null-reference error whenever I added a new HOTweenComponent, or opened the HOTween Editor window the first time. It was harmless (as in it would work anyways) but it wouldn't look good in the video I'm making, so I've managed to fix it like that:

    HOTweenEditorGUI.cs:
    Code (csharp):
    1. GUIStart()
    2.         if (src.tweenDatas == null) return;
    3.         ###before:
    4.         foreach (HOTweenManager.HOTweenData twData in src.tweenDatas) {
    5.  
    6. DrawDefaultMode()
    7.  
    8.         if (src.tweenDatas == null) return;
    9.         ###before:
    10.         if (src.tweenDatas.Count == 0  Event.current.type == EventType.Repaint) return;
    It does cause a problem when you open the editor window the first time though, the list of tween-able properties show up then disappear, so it's officially a NotGood™ fix - although it's sufficient for what I'm using. What do you think doctor, can we have any hopes? :)

    I'm also trying to better organize the editor, as soon as I get a decent version I'll send it for your appreciation.
     
  2. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Ehe it took me a while to replicate this bug, since I added HOTweenComponent while having the target gameObject selected in the Hierarchy. I finally realized this error happens only if you drag HOTweenComponent on a non-selected gameObject (and have no idea what causes it in the global Visual Editor, since that I wasn't able to replicate).

    It's a strange error, since the inspector/editor is disabled by default (and thus it should never reach that line of code in GUIStart) and, when I enable it, first thing I do is set src.tweenDatas to a new List. Anyway, this new version should have solved it (I simply initialize src.tweenDatas from the beginning, instead than waiting for the inspector/editor to be enabled). Could I ask you to try it out before I release it, so I'll be sure it's truly solved?

    Here it is (v1.0.101beta), and thanks :)

    EDIT
    P.S. I'm all for organization (at least when concerning work, for the rest I'm a total mess :p), eager to see yours :)
     
    Last edited: Aug 17, 2012
  3. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    It works! :D

    I've found the editor to be laid out ok for the editor window, but for the component inspector.. ahem :) Too much wasted space and scroll bars showing up when the inspector column was set to minimum width were its main sins. Now someone is reading and thinking "well, just fix it". Yeah right, I wish inspector editor editing were such a simple affair. I took my entire day working on this, such a pain.. I almost quit, but in the end I felt it was worth it - imo the usability of HOTween's visual component was the weakest link while creating the "Time Tunnel" GUI.

    Some fields aren't set to auto-stretch (and thus look spaced out in the editor window) simply because auto-stretch is a bitch when you want to lay two or more fields in the same line. It stops responding to LookLikeControls settings except if you set a fixed width to all but one of the fields.

    Something else that ruins inspector developer's life is the nested horizontal and vertical blocks. I got headaches just by looking at that code, and it's not even your fault, the way the API is laid out is a receipt for maintenance disaster. So I decided to invest some time in something I wanted to test for ages, creating some macro-like lambdas. The idea was having something similar to our "Boo Inspector" component, where you don't need to declare BeginHorizontal/EndHorizontal command pairs like there's no tomorrow. In the end that's what I got:

    Code (csharp):
    1.     private static Action<Action> GUILayoutHorizontal = horizontalBlockActions => {
    2.                                                             GUILayout.BeginHorizontal();
    3.                                                             horizontalBlockActions();
    4.                                                             GUILayout.EndHorizontal();
    5.                                                         };
    With this you can use the following syntax to define a horizontal block:

    Code (csharp):
    1.     GUILayoutHorizontal(delegate {
    2.         Tons of C# commands here
    3.     });
    Nothing else needed, it even works with nested GUILayoutHorizontal commands, which's very cool. The only limitation (compared to the amazing Boo macros) is that you can't detour execution flow (break/continue/return), which did happen in your code a couple times. Anyways, theoretically in these cases you'd call a method instead, but you can also define a Func instead of an action and receive a boolean that flags if you should break, etc. I didn't go that far really, was most of a (well succeeded :)) experiment that I used sparringly to help me disentangle the code enough to do what I wanted. But it seems a nice candidate for a full Inspector API - hint, hint ;) The above code with a couple variations is right before the "DrawTween" method in HOTweenEditorGUI.cs.

    Well, it's 4 AM and I'm tired as hell so I'll stop typing, but at least it's "mission accomplished" for me. Changed files go attached. Hopefully you find the layout as tidy as I did and adopt it - even if just partially :)
     

    Attached Files:

  4. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Awesome!!!! :) You're right about the waste of space. I wanted to re-organize it, but then kept delaying it. I'll be busy for the next couple days, but I'm very eager to check what you did in coding terms, and the micro-lambdas look very interesting.

    Also, sorry for the mess. It's true that GUI Layouts create all kind of headaches, but it's also true that I coded the first version of the Visual Editor very quickly, and thus the code is very messy :p I was wondering, since you know a lot of stuff, if Unity 4 will also have a different Editor GUI API?
     
  5. Dgizusse

    Dgizusse

    Joined:
    Feb 1, 2012
    Posts:
    30
    I've just come across a case where a 0 duration tween would be useful in a Sequence and and can't seem to make it work...

    Here's a simplified version of the code I use:
    Code (csharp):
    1. void Start () {
    2.     Sequence s = new Sequence();
    3.     s.Append(HOTween.To(transform, 5.0f, "position", new Vector3(5.0f, 0.0f, 0.0f), true));
    4.     s.Append(HOTween.To(transform, 0.0f, "eulerAngles", new Vector3(0.0f, 0.0f, 45.0f)));
    5.     s.Append(HOTween.To(transform, 5.0f, "position", new Vector3(-5.0f, 0.0f, 0.0f), true));
    6.     s.Play();
    7. }
    I've also tried to Insert the tween with no success.

    If I put a very short time, it works as expected but that's an ugly hack that's I'd rather not use.

    Thanks!
     
  6. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Wow, this is a general information post: you gotta see the RageSprite demo. There's a little HOTween in there, so it's related to this thread, and what RageSprite does is, uh, awesome! I waited this demo a long time and I'm so thrilled to finally get to see it :)

    @Dgizusse: I'm being very busy these days, but I hope I'll be able to get to this and fix it tomorrow afternoon. I have to admit I never thought to check 0 duration tweens with Sequences, but now that you mention it, I see how it could be useful :p
     
  7. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Thanks a lot, Daniele - without HOTween it wouldn't be possible in the short time frame I had, neither with such a smooth tweening performance.
    HOTween rocks! ^_^

    BTW, I've made a couple tiny fixes and changes to the editor (after that version I've attached), I'll send it to you later today. Cheers!
     
  8. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Awesome :) And sorry if I didn't have the time yet to check the re-ordered Visual Editor or the 0 duration Sequence bug. Busy became superbusy and then hyperbusy. But I hope tomorrow I'll get back to my usual responsiveness :p
     
  9. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Whew done, this was more complicated than I thought...

    HOTween update: v1.1.371

    - Additional low-level optimizations by Dmitriy Yukhanov
    - 0 durations tweens are now working also when inside Sequences
    - Fixed bug with Complete method not working correctly when used on Quaternion properties with a Vector3 endValue

    As usual, last version is on HOTween's website.

    @Dgizusse: this fixes the 0 duration bug in Sequences - sorry for taking so long :)

    @MaDDoX: still didn't manage to play with your Visual Editor optimizations. I was still timeless, and got to the bugs first :B

    That said, I have an announcement: Dmitriy Yukhanov became a committer for HOTween, and added some low-level optimizations to make it speedier :)
     
  10. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    The version number should be 1.2.000. This is a sort of Quantum Leap. A "Welcome on board, Dimitriy". ;)
     
    Last edited: Aug 26, 2012
  11. Dgizusse

    Dgizusse

    Joined:
    Feb 1, 2012
    Posts:
    30
    Thanks for the latest version!

    When using the OverwriteManager, if I kill a tween using the intID or ID and start a new Tween with the same target, I'll get this warning:
    Code (csharp):
    1. HOTween : PlugVector3 is overwriting PlugVector3 for Target (UnityEngine.Transform).position
    However, if I keep a reference to the Tweener and kill it directly I won't receive a warning.

    It seems that the OverwriteManager keeps a reference to the Tweener forever when killing by id.
     
  12. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    New HOTween update: v1.1.401

    - Added OnPluginOverwritten callback to Tweeners
    - Now tweens are updated in growing order, which leads to better behaviour of various things, and correct overwriting when 2 overwriting tweens start at the same exact time
    - Added more low-level optimizations based on Dmitriy's advice (replaced all foreach loops)
    - Fixed tweens not being correctly killed and removed from OverwriteManager when using HOTween.Kill method

    The new OnPluginOverwritten callback is dispatched each time the overwrite manager overwrites a plugin of a Tweener (which is the only thing that can be overwritten), and obviously works only if you initialized HOTween and activated the OverwriteManager. Remember that you can create a Tweener with multiple plugins (see example), and thus when OnPluginOverwritten is called it doesn't mean that the whole Tweener has been killed. You can check myTweener.destroyed to know if it was actually killed.

    EXAMPLE

    Code (csharp):
    1.  
    2. void Start()
    3. {
    4.     // Create a tween which uses 2 Prop plugins
    5.     HOTween.To(myTransform, 1, new TweenParms()
    6.         .Prop("position", new Vector3(5f,0,0))
    7.         .Prop("rotation", new Vector3(0,180f,0))
    8.         .OnPluginOverwritten(OnPluginOverwrittenCallback)
    9.     );
    10. }
    11.  
    12. // Callback for when a plugin is eventually overwritten
    13. void OnPluginOverwrittenCallback(TweenEvent e)
    14. {
    15.     // Logs true if the whole Tweener was killed
    16.     // (which means that all the plugins used by the Tweener were overwritten)
    17.     Debug.Log(e.tween.destroyed);
    18. }
    19.  
    As usual, you can get the latest version on HOTween's website.

    @Dgizusse: wow, thanks for catching that bug! That was huge, and you were right: tweens weren't removed from OverwriteManager when using HOTween.Kill in any of its forms. This version fixes it.
     
  13. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Wait! Sorry but I just discovered I might've introduced a new bug in the latest version, so don't download it yet, while I check it out. Sorry for that :p
     
  14. Dgizusse

    Dgizusse

    Joined:
    Feb 1, 2012
    Posts:
    30
    Thanks again for the quick fix!
     
  15. Dgizusse

    Dgizusse

    Joined:
    Feb 1, 2012
    Posts:
    30
    Doh, too late... I'll revert for now then.
     
  16. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    New HOTween update: v1.1.402

    - fixes bug introduced in v1.1.401

    As usual, latest version is on HOTween's website

    @Dgizusse: sorry, now it's ultra-checked :p
     
  17. Deleted User

    Deleted User

    Guest

    I made a rail camera system running on HOTween, it's pretty much done and working. However, I want to interpolate the movement a little so it's not completely rigid. I successfully managed to get the interpolation itself working by adding Vector3 fields representing position, angle and FOV to the camera script and interpolating to these instead of moving directly. However, when I try to use PlugVector3Path to animate the proxy fields, I get an exception. This does not occur when I animate the transform's position and eulerAngles fields directly.

    Wrapping those fields in properties doesn't help one bit. I tried animating same properties in other objects instead of "this" and it still didn't work. Then I made an empty gameobject and tried to animate its transform and yet it still crashed. Not a single damn thing besides this one transform works. Why does it even take a parameter if it can't work with anything other than "transform"?

    Update: This happens only when I try to use prop chaining to animate both position and angle.
     
    Last edited by a moderator: Sep 4, 2012
  18. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Hi Brobot,

    you can definitely animate any public field/property, and not only Transforms. Could you manage to reproduce this bug in a few lines of code, and send me the code you're using to generate the Sequence? So I can look at it and see what's happening.
     
  19. Deleted User

    Deleted User

    Guest

    Actually, I played around with it some more and it seems that the problem is that PlugVector3Path can't accept arrays with one element (which is useful if you want one property to remain constant in some cases). It would be really helpful if you could make that part bulletproof by creating a duplicate point in that case, or handle the exception with a meaningful error message. There doesn't seem to be anything regarding the path's requirements in the documentation either so it would be a good idea to update that as well.

    Here's a class that can easily reproduce the error, just make a less-than-two-element list in the editor for either property.

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5. using Holoville.HOTween;
    6. using Holoville.HOTween.Plugins;
    7.  
    8. public class PathTest : MonoBehaviour
    9. {
    10.  
    11.     /// <summary>
    12.     /// List of vertices forming a path. Set in editor.
    13.     /// A ONE ELEMENT LIST CRASHES THE PLUGIN
    14.     /// </summary>
    15.     public List<Vector3> path , angles;
    16.  
    17.  
    18.     /// <summary>
    19.     /// Vector used for interpolation. Do not modify in editor.
    20.     /// </summary>
    21.     public Vector3 interpPos , interpAngle;
    22.  
    23.  
    24.     /// <summary>
    25.     /// Interpolation speed. Set in editor.
    26.     /// </summary>
    27.     public float speed;
    28.  
    29.  
    30.     /// <summary>
    31.     /// Duration of the sequence. Set in editor.
    32.     /// </summary>
    33.     public float duration;
    34.  
    35.     /// <summary>
    36.     /// Sequence used to animate along the path.
    37.     /// </summary>
    38.     Sequence seq;
    39.  
    40.  
    41.     /// <summary>
    42.     /// Executed on startup by Unity.
    43.     /// </summary>
    44.     void Start()
    45.     {
    46.         // Init the engine.
    47.         HOTween.Init();
    48.  
    49.         // Create the sequence.
    50.         seq = new Sequence();
    51.  
    52.         // Create the path.
    53.         AppendPositionAndAngle();
    54.  
    55.     }
    56.  
    57.     /// <summary>
    58.     /// Append a PlugVector3Path using position and angle.
    59.     /// </summary>
    60.     void AppendPositionAndAngle()
    61.     {
    62.         seq.Append( HOTween.To( this , duration , new TweenParms().Prop
    63.             ( "interpPos" , new PlugVector3Path( path.ToArray() , EaseType.Linear , false ) ).Prop
    64.             ( "interpAngle" , new PlugVector3Path( angles.ToArray() , EaseType.Linear , false ) ) ) );
    65.     }
    66.  
    67.     /// <summary>
    68.     /// Executed each frame by Unity.
    69.     /// </summary>
    70.     void Update()
    71.     {
    72.         // The script crashes when a path with one vertex is used.
    73.         seq.GoTo( Time.time % seq.duration , true ); //Loops over and over.
    74.    
    75.         transform.position = Vector3.Lerp( transform.position , interpPos , speed * Time.deltaTime );
    76.  
    77.         transform.rotation = Quaternion.Slerp(
    78.             transform.rotation , Quaternion.Euler( interpAngle ) , speed * Time.deltaTime );
    79.     }
    80. }
    81.  
    82.  
     
  20. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Brobot, before adding more conditionals to PlugVector3Path (which would slow performance, even if just a little), I want to be sure it's a necessary feature. A single-point array is never a path (geometric-wise and tween-wise), and if you just want to keep a Vector3 constant you could use a tween callback (like OnUpdate) to reset its value after each tween update.

    In short words, allowing the use of PlugVector3Path with something that is not a path looks like a useless addition to me, but please help me to understand better if I got it wrong.
     
  21. Deleted User

    Deleted User

    Guest

    As I said, if a safe fallback when creating paths isn't possible then please at least handle invalid arrays with a less cryptic error message.
    The plugin is great by the way, my camera system is already up and running thanks to it.
     
  22. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Hey Brobot. I played a little more with your example. In the next release I will add a better warning message if an invalid single point path is created.

    By the way, I forgot to write some additional information. You actually CAN create a single point path, if the single point is different than the starting point of the tweened property. That's because HOTween automatically adds the starting position to the path, and that way, an actual 2-points path is created. Problems (like in your case) start to happen when both points coincide (meaning that the starting point is the same as the end point - when passing a single point array), because that's when no additional point is created, and thus no path.
     
  23. Dgizusse

    Dgizusse

    Joined:
    Feb 1, 2012
    Posts:
    30
    Hi,

    Would it be possible to add HOTween.GetTweensByIntId(int id) like we already have for string ids?

    Thanks!
     
  24. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Sure! Now that you mention it, it looks like a good idea and a missing feature. I'll be travelling for the next couple days, but after the weekend I'll do it :)
     
  25. yuewahchan

    yuewahchan

    Joined:
    Jul 2, 2012
    Posts:
    309
    1. For the PlugVector3Path, is it possible to animate a Vector3 (like a Transform.position) along a straight path instead of curved path ?

    2. When move in closed loop and repeat, it will loop itself in the end point.



    Code (csharp):
    1. HOTween.To( this.transform, 5f, new TweenParms().Prop("position", new PlugVector3Path( path.ToArray(), EaseType.Linear ).ClosePath() ).Loops(100) );
     
    Last edited: Sep 13, 2012
  26. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    1. No straight path movement options, for now. But I'll think about adding it, since it should be definitely much simpler than curved paths.
    2. When a path tween is created, if the transform position doesn't coincide with the first path point, an additional segment is created in order to have the transform reach the first point. If you want to follow the exact path you created, be sure to set the transform at the first path position, before creating the tween.
     
  27. burost

    burost

    Joined:
    May 15, 2012
    Posts:
    5
    You can animate a Vector3 along straight segments by using regular tweens nested inside a sequence.
     
  28. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    quick question about GetTweenersByTarget()

    I can't get it to return anything... I am confused.

    I do have a tween component with one tween ( a simple rotation tween) on that gameObject I pass to GetTweenersByTarget, but still I get an empty list.

    Is there a sample or a code sample available for me to get my head around this?

    thanks for your help,

    Jean
     
  29. hexdump

    hexdump

    Joined:
    Dec 29, 2008
    Posts:
    443
    Hi!,

    Incredible lib. I have been reading through the thread but just found some reference to movile (ios/android) in the first pages. Could anyone bring some information about their experiences with ios/andorid with HotTween? Is it fast? Can be used in a game not just menues without slowliness? I'm not talking about iphone 4s :), for example an iphone 3gs.

    Thanks for all the work and time you put here.
     
  30. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @burost: that's a nice trick, thanks for mentioning it :)

    @Jean Fabre: remember that you have to pass the correct target to GetTweenersByTarget. Which, in case of a rotation tween, will be the transform, and not the gameObject. Also remember that, if you didn't set the autoKill/AutoKill property to false, a Tweener will be destroyed after all its loops are completed, and thus won't be found by GetTweenersByTarget anymore. Example:
    Code (csharp):
    1.  
    2. HOTween.To(myGameObject.transform, 1, "rotation", new Vector3(0,0,180));
    3. List<Tweener> tweenersByTarget = HOTween.GetTweenersByTarget(myGameObject.transform, false);
    4.  
    @hexdump: hi! :) From my experience, it works very nicely. The game I'm working on (Journeyballs) is small but uses quite a lot of tweens, and it runs at 53fps on my 2-years old HTC Desire, and stays at the 30fps cap on iPhone 3 and iPad 2 (though the videos on the website run at a much slower fps, because I didn't use FRAPS to record them). If you want to dig more, you could download HOTween's test run, update it with the latest HOTween version (since the test run still uses a quite old - and slower - version), and build it for Android/iOS.

    P.S. update is a little delayed, sorry for that. My laptop fan broke and all my computer vibrates when said fan turns on, but I should release it within today, max tomorrow.
     
    Last edited: Sep 17, 2012
  31. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    hi,

    I see, my mistake, I was reading GetTweenersByGameObject() in my mind. I get it to work now, thanks!

    bye,

    Jean
     
  32. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Delay update: I finally (I hope) got my computer back and working (I found the best technician ever - Filip - here in Niš, Serbia, who is a magician and the first person that really knew how to deal with the beastly Dell Precision M6400 I own - and I also got a supergiantcooler to prevent future issues). So, if nothing bad happens and nothing explodes within the day, I'll finally release HOTween's update tomorrow. Sorry for the wait.
     
  33. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    New HOTween update: v1.1.420

    - Added HOTween.GetTweensByIntId method
    - OnPluginOverwritten callback can now be used with ApplyCallback method
    - Fixed bug when killing a tween during a callback different from OnComplete

    As usual, latest version is on HOTween's website

    And sorry for the week-long delay. But on a side note, my computer works wonderfully now :) #happygeek
     
  34. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    @MaDDoX: hey Breno, I forgot to mention... I'm looking into your changes to HOTween Visual Editor, and getting to love your delegate method. Right now I'm building a GUI system to be re-used through all editors panels (which is not the Inspector/Window system I was working on a while ago). When it's finished, I'll completely rebuild HOTween Visual Editor appearance, hopefully making it much nicer and following your more compact guidance :)
     
  35. Nezabyte

    Nezabyte

    Joined:
    Aug 21, 2012
    Posts:
    110
    I'm seeing these errors with HOTween v1.1.420 --

    Error CS1502: The best overloaded method match for 'Holoville.HOTween.TweenParms.OnComplete(Holoville.HOTween.Core.TweenDelegate.TweenCallbackWParms, params object[])' has some invalid arguments (CS1502) (Assembly-CSharp)

    Error CS1503: Argument '1': cannot convert from 'UnityEngine.GameObject' to 'Holoville.HOTween.Core.TweenDelegate.TweenCallbackWParms' (CS1503) (Assembly-CSharp)

    Error Error: System.IO.FileLoadException: Could not load file or assembly 'file:///\Assets\HOTween.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) (Error: System.IO.FileLoadException: Could not load file or assembly 'file:///\Assets\HOTween.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT) (Assembly-UnityScript)

    System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information. (File name: 'file:///C:\Assets\HOTween.dll' ---> System.NotSupportedException) (Assembly-UnityScript)
     
  36. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Hey Nezabyte,

    the first two errors should be user-related: they seem to be there because either a) you tried to pass only a gameObject parameter to an OnComplete callback, or b) you were trying to use the "SendMessage" overload of OnComplete, but passed to it only the sendMessageTarget and no methodName parameter.

    The other 2 errors seem some strange Unity related ones, I believe. Did you try restarting Unity? Are you keeping HOTween files inside your project's Asset folder? Also: are you somehow using .NET 4 instead of 3/3.5?
     
    Last edited: Sep 21, 2012
  37. dev_peter

    dev_peter

    Joined:
    Aug 9, 2012
    Posts:
    38
    are you updating the store version too? It would be easier to download the updates
     
  38. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    I usually don't update the store version as much as the website one, but will try to keep up with it more. This last version was just submitted (usually takes a day to get approved).
     
  39. Nezabyte

    Nezabyte

    Joined:
    Aug 21, 2012
    Posts:
    110
    I checked the build settings for Mono, and for some reason it was still using Microsoft .NET. I switched it to Mono 2.10.8 and tried rebuilding. The first 2 errors disappeared, but the last 2 errors are still appearing in regards to having trouble loading the HOTween assembly. I assume it was built with target x86? Not sure what's going on.
     
  40. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Sorry for this issue, I'm not sure what's going on either (btw, HOTween is built with "anyCPU" as target)

    In the meantime, I gathered some additional information, and the only cause for this error seems to be related to the more recent security restrictions of .NET 4.0 (infos on MSDN and some blogs). I also found another Unity user having the same issue, this time with PlayMaker, but no answer yet. The things that is strange, is that Unity has nothing to do with .NET 4.0, as far as I know.

    Are you getting these errors from Unity itself, or from the code editor? Also, could you try to install a previous version of HOTween and see if you still get this error?

    To all other users: did any of you happened on this issue? Or knows what might be the cause of it?

    EDIT
    opened a thread about this issue, hoping to find some answer
     
    Last edited: Sep 21, 2012
  41. Nezabyte

    Nezabyte

    Joined:
    Aug 21, 2012
    Posts:
    110
    These errors are coming from MonoDevelop. I had the same issue with the previous version as well.

    One thing worth trying is having it compiled as x86? I'm running a 64-bit machine, so it's going to get loaded in as such. It's a problem if any of its dependencies are x86.
     
  42. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    I'm on the phone now, but tomorrow when I get back to the computer I'll try to send you a x64 version (I guess that's what you meant, and not x86?). By the way, on the thread I opened dreamora was suggesting that maybe it's because the project was started with UnityVS (in case you're collaborating on a project and someone else started it)?
     
  43. Nezabyte

    Nezabyte

    Joined:
    Aug 21, 2012
    Posts:
    110
  44. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
  45. Nezabyte

    Nezabyte

    Joined:
    Aug 21, 2012
    Posts:
    110
    That unfortunately didn't work lol. But it did make me realize all the monodevelop project files are being built as AnyCPU. Sorry, didn't think about that scenario until now. I spoke to my co-programmer about the errors, and he thinks maybe you just aren't supposed to ever use/need "Build ALL" in MonoDevelop for a Unity game, especially since the errors don't appear in the Unity debugger, only in monodev.

    Oh and thanks for making the other thread. We've only been utilizing Unity and MonoDevelop for this project, so don't think it would be related to VS.
     
  46. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Well at least we tried :) I don't use MonoDevelop since a while (usually use a combo of Visual Studio and Sublime Text), but when I did I always used the "Build ALL" command. It's quite useful if you want to check for errors/warnings without having to jump in and out of Unity, so it should work. Maybe there's a bug with the latest version that came with Unity, and it will be fixed in the next release?

    By the way, another thing that came to my mind: did you check if for some reason your "Assembly-CSharp" build settings are set to "Mono / .NET 4.0" instead than "Mono / .NET 3.5"?
     
  47. Nezabyte

    Nezabyte

    Joined:
    Aug 21, 2012
    Posts:
    110
    Yes, while I was digging around through the different options in MonoDev yesterday, I did see it was set to Mono/.NET 3.5. We are both much more familiar with Visual Studio but had figured we'd use MonoDev for the convenience features between it and Unity, despite us being unfamiliar with this IDE.

    HOTween does seem to work within Unity itself, so perhaps it's a bug of some sort like you said. Will let ya know if we ever figure out more about it.
     
    Last edited: Sep 23, 2012
  48. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Thanks for keeping me informed :)

    By the way, I suppose a temporary solution could be to actually add <loadFromRemoteSources enabled="true"/> to your configuration, as the MSDN page states. It wouldn't explain why this is happening, but it should at least fix it.
     
  49. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,047
    Hi for my application I need to rotate a 3D object (reel) on one direction over 1-5 seconds. I was precomputing the total number of degrees that the rotation should make in 15 deg increments(minimum 375 deg and less then 720 deg). I had some code that would rotate the object 15 deg at a time in fixed update until the starting rotation + the additional rotation was reached. This worked okay but I really would like to use some easing.

    I had tried iTween in the past but I could not get it to work. I am trying it now with HoTween but running into an issue. The first rotation works fine but subsequent rotations might be in the correct direction or the opposite direction.

    Any suggestion on how to ensure the object only turns in one direction?

    iByte
     
  50. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,242
    Hi ibyte,

    when you tween a rotation value (whose end value can be passed both as a Vector3 of euler angles or as a Quaternion), you can do it in 3 different ways:

    Regular rotation tween
    Will rotate for a max of 180 degrees, choosing the shortest rotation required to reach the given end rotation
    Code (csharp):
    1.  
    2. HOTween.To(myTransform, 1, "rotation", new Vector3(0,270,0));
    3.  
    Relative rotation tween
    Will rotate for the exact amount of given degrees, which are added (or removed if negative) from the original rotation
    Code (csharp):
    1.  
    2. HOTween.To(myTransform, 1, "rotation", new Vector3(0,270,0), true);
    3.  
    Beyond360 rotation tween (requires using TweenParms and directly assigning a PlugQuaternion plugin)
    Will reach the given rotation by moving clockwise or counterclockwise, depending on the sign of the end values
    Code (csharp):
    1.  
    2. HOTween.To(myTransform, 1, new TweenParms().Prop("rotation", new PlugQuaternion(new Vector3(0,270,0)).Beyond360()));
    3.  
    In your case, I'd say Beyond360 is what you're looking for :)