1. All Unity Pro perpetual license customers: your special offer to subscribe is ready! Click here.
  2. We're running a survey about the usage of our graphics pipeline, help give us your feedback.
  3. Unity 5.6 beta is now available for download.
  4. Unity 5.5 is now released.
  5. Check out all the fixes for 5.5 in patch releases 1 & 2.
  6. Enter the Google Play Indie Games Contest in Europe. Read more about it here.
  7. Get prepared for the Tizen Mobile App Incentive Program! Read more about the upcoming program here.
  8. Enter the Microsoft Developer Challenge for a chance to win prizes. Read more about it here.

HOTween: a fast and powerful Unity tween engine

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

  1. LighterS

    LighterS

    Joined:
    Nov 7, 2013
    Messages:
    8
    First, thanks for working on this. It's amazing.

    So the thing I'm working on is 1) dynamically generate/destroy GameObjects and put/remove them in/from a List<GameObject>, 2) when need to tween some of the GameObjects, check if the object is during a tweening, if so, complete the current one and add a new tweener.

    My problem is: how can I tell the specific tweener to complete?

    Thanks for your time.
     
    Last edited: Jan 3, 2014
  2. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    Glad you like it LighterS :)

    If you're tweening a Transform, and since you have a list of GameObjects, you can use HOTween's static methods, like this:
    Code (csharp):
    1.  
    2. HOTween.Complete(myGameObject.transform);
    3.  
    which will complete all the tweens (not nested tweens inside sequences though) whose target is the one passed.
     
  3. LighterS

    LighterS

    Joined:
    Nov 7, 2013
    Messages:
    8
    Wow, thank for the quick reply, Izitmee. Problem solved. :D
     
  4. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    @LigherS: you're welcome :)

    @Flashist: I just fixed your issue. Can you download the latest DLL from Google Code's bin and check if everything's alright too? Let me know.
     
  5. Flashist

    Flashist

    Joined:
    Jun 25, 2013
    Messages:
    11
    Hi.

    Thank you very much for your incredibly fast feedback!

    Unfortunately, I can't check new .dll, because I have some problems with using it (Unity Editor shows me a lot of errors and warnings). I think it will be OK for me to wait HOTween's update through Asset Store.

    Regards,
    Mark.
     
  6. basilbits

    basilbits

    Joined:
    Jan 3, 2014
    Messages:
    110
    i like sticking with old fashioned because i dont know what im getting into. sorry:sad:
     
  7. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    @Flashist: woah, wait there, that's scary. Can you tell me what errors you're getting? The Asset Store version will contain the same DLL that you would download from Google Code. Did you replace the HOTween.DLL file you already had in your project, or you just added it and thus Unity was finding two DLLs?

    @basilbits: :O
     
  8. Flashist

    Flashist

    Joined:
    Jun 25, 2013
    Messages:
    11
    Hi =)

    I have tried next things:
    1) I've downloaded HOTween.dll and HOTween.dll.mdb files from Google.Code.
    2) I've made .zip copy from previous files, which is placed inside folder HOTween\Plugins.
    3) I've deleted previous HOTween.dll and HOTween.dll.mdb and copied new files to folder HOTween\Plugins.
    4) Unity Editor shows me next errors:

    - Internal compiler error. See the console log for more information. output was:Error: System.BadImageFormatException: Could not load file or assembly 'Assets/Scripts/HOTween/Plugins/HOTween.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
    File name: 'Assets/Scripts/HOTween/Plugins/HOTween.dll'
    at (wrapper managed-to-native) System.Reflection.Assembly:LoadFrom (string,bool)
    at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00000] in <filename unknown>:0
    at us.UnityScriptCompilerFactoryModule.loadAssembly (System.String name) [0x00000] in <filename unknown>:0
    at us.UnityScriptCompilerFactory.FromCommandLineOptions (us.CommandLineOptions options) [0x00000] in <filename unknown>:0
    at us.UsModule.compile (us.CommandLineOptions options) [0x00000] in <filename unknown>:0
    at us.UsModule.runWithCommandLine (System.String[] commandLine) [0x00000] in <filename unknown>:0
    at us.UsModule.Main (System.String[] argv) [0x00000] in <filename unknown>:0

    - Internal compiler error. See the console log for more information. output was:error CS0009: file `Assets/Scripts/HOTween/Plugins/HOTween.dll' has invalid `assembly' metadata
     
  9. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    Ow, there must be some issue with the Google Code upload/download then. Really weird. If you want to use it before I submit to the Asset Store (I still have to make a couple additional features, so it might take a while), here is a regular ZIP, which I'm sure has no such issues.
     
  10. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Messages:
    226
    It's me again, but this time I am having a hard time building for Windows Store due to some Holoville errors

    For reference I also have a bunch or warnings from Holoville and other plugins... App runs fine and I can build for iOS and Android but I seem unable to build for Windows Store due to these five errors:

    Assets\Holoville\HOTween Extensions\HOTweenManager\HOTweenManager.cs(232,49): error CS1061: 'System.Type' does not contain a definition for 'Assembly' and no extension method 'Assembly' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)

    Assets\Holoville\HOTween Extensions\HOTweenManager\HOTweenManager.cs(308,85): error CS1061: 'System.Type' does not contain a definition for 'Assembly' and no extension method 'Assembly' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)

    Assets\Holoville\HOTween Extensions\HOTweenManager\HOTweenManager.cs(314,84): error CS1061: 'System.Type' does not contain a definition for 'Assembly' and no extension method 'Assembly' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)

    Assets\Holoville\HOTween Extensions\HOTweenManager\HOTweenManager.cs(364,65): error CS1061: 'System.Type' does not contain a definition for 'Assembly' and no extension method 'Assembly' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)

    Error building Player because scripts had compiler errors



    Thanks

    UPDATE


    I get the following error when building for Windows Phone:

    Error building Player: Exception: Error: type `System.Reflection.Emit.AssemblyBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.ModuleBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.AssemblyBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.AssemblyBuilderAccess` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: method `System.Reflection.Emit.AssemblyBuilder System.AppDomain::DefineDynamicAssembly(System.Reflection.AssemblyName,System.Reflection.Emit.AssemblyBuilderAccess)` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.AssemblyBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.ModuleBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: method `System.Reflection.Emit.ModuleBuilder System.Reflection.Emit.AssemblyBuilder::DefineDynamicModule(System.String)` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.ModuleBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: method `System.Reflection.Emit.TypeBuilder System.Reflection.Emit.ModuleBuilder::DefineType(System.String,System.Reflection.TypeAttributes)` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: method `System.Void System.Reflection.Emit.TypeBuilder::AddInterfaceImplementation(System.Type)` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.ConstructorBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: method `System.Reflection.Emit.ConstructorBuilder System.Reflection.Emit.TypeBuilder::DefineDefaultConstructor(System.Reflection.MethodAttributes)` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: method `System.Type System.Reflection.Emit.TypeBuilder::CreateType()` doesn't exist in target framework. It is referenced from HOTween.dll at System.Reflection.Assembly FastDynamicMemberAccessor.MemberAccessor::EmitAssembly().
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.MemberAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.MemberAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.PropertyAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.MethodBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.PropertyAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.PropertyAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.MethodBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.PropertyAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: method `System.Reflection.Emit.MethodBuilder System.Reflection.Emit.TypeBuilder::DefineMethod(System.String,System.Reflection.MethodAttributes,System.Type,System.Type[])` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.PropertyAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.MethodBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.PropertyAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: method `System.Reflection.Emit.ILGenerator System.Reflection.Emit.MethodBuilder::GetILGenerator()` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.PropertyAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.PropertyAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.MethodBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.PropertyAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.PropertyAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.MethodBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.PropertyAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
    Error: method `System.Reflection.Emit.MethodBuilder System.Reflection.Emit.TypeBuilder::DefineMethod(System.String,System.Reflection.MethodAttributes,System.Type,System.Type[])` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.PropertyAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.MethodBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.PropertyAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
    Error: method `System.Reflection.Emit.ILGenerator System.Reflection.Emit.MethodBuilder::GetILGenerator()` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.PropertyAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.FieldAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.MethodBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.FieldAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.FieldAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.MethodBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.FieldAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: method `System.Reflection.Emit.MethodBuilder System.Reflection.Emit.TypeBuilder::DefineMethod(System.String,System.Reflection.MethodAttributes,System.Type,System.Type[])` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.FieldAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.MethodBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.FieldAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: method `System.Reflection.Emit.ILGenerator System.Reflection.Emit.MethodBuilder::GetILGenerator()` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.FieldAccessor::_EmitSetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.FieldAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.MethodBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.FieldAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.TypeBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.FieldAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.MethodBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.FieldAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
    Error: method `System.Reflection.Emit.MethodBuilder System.Reflection.Emit.TypeBuilder::DefineMethod(System.String,System.Reflection.MethodAttributes,System.Type,System.Type[])` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.FieldAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
    Error: type `System.Reflection.Emit.MethodBuilder` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.FieldAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
    Error: method `System.Reflection.Emit.ILGenerator System.Reflection.Emit.MethodBuilder::GetILGenerator()` doesn't exist in target framework. It is referenced from HOTween.dll at System.Void FastDynamicMemberAccessor.FieldAccessor::_EmitGetter(System.Reflection.Emit.TypeBuilder).
     
    Last edited: Jan 4, 2014
  11. Flashist

    Flashist

    Joined:
    Jun 25, 2013
    Messages:
    11
    Hi.

    Thank you very much. Your last .zip works well for me)
     
  12. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    @Flashist: great :)

    @gegagome: hi. Those Windows Phone errors happen because you need to use HOTweenMicro there. Just download it and replace the HOTween files with the HOTweenMicro ones, and everything will work. About Windows Store instead, those errors were happening with the Visual Editor a while ago but they were solved: can you confirm you're using the latest version of both HOTween and the Visual Editor?
     
  13. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    New HOTween Update v1.1.890

    - Fixed flickers with first loop when using FixedUpdate
    - OnComplete's TweenEvent now still reports the correct tween target instead than null
    - Fixed relative zero-duration tweens not working correctly

    Download it from the website, since for now I'm not pushing it to the Asset Store (want to do a couple more things first).
     
  14. germ

    germ

    Joined:
    Oct 21, 2013
    Messages:
    2
    Hey there. Giving HOTween a try... So far, I like it. But I'm having a problem when I try to deploy and run my project on iOS. Some possibly important bits of info:

    - Tried multiple versions of HOTween: the previous and the current (1.1.890), both the regular and micro versions.
    - Using Unity (Free) 4.2.2f1 on Mac OS X 10.9, Xcode 5.0.2.
    - Target platform is an iPad 2 running iOS 7.

    I can include the library in the project, and include "using" references in my C# files. But it seems that as soon as I try to make use of it, like this:

    HOTween.To(transform, Duration,
    new TweenParms().Prop("position", calculateRandomPosition(originalPosition)).
    Prop("rotation", Random.rotation).
    Ease(EaseType.EaseInOutSine));

    It works great... Until I exit the program on iOS. When I do that, the program attempts to shut down and I get EXC_BAD_ACCESS, it looks like when it's calling a function called CleanupMono(). (I can provide an image of the stack trace if interested.)

    Ordinarily, I wouldn't be quick to point fingers at HOTween (and I'm still willing to hear otherwise)... But if I run the program with the line above commented out, it exits cleanly. I put it in, and I start getting these failures on shutdown. The above line doesn't even actually have to get executed. Just the act of including it seems to trigger the problem. I find this strange.

    I'm fairly new to Unity. No suggestions too simple. Any thoughts?
     
  15. Vevusio

    Vevusio

    Joined:
    Oct 13, 2013
    Messages:
    22

    Attached Files:

    Last edited: Jan 7, 2014
  16. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    @Vevusio: that is awesome!!!! :) Let me know if you have a preferred link for that, and I'll link to it from HOTween's website.

    @germ: EXC_BAD_ACCESS happens 99% of the time because of a NullReferenceException. In your case, if related to HOTween, it means that when you exit the program, you destroy some stuff while the tween is still running, and thus its target becomes null and there it goes with a NullReferenceException. If you're simply closing everything via Application.Quit, then it's a new Unity bug, but you can solve it by calling
    Code (csharp):
    1.  
    2. HOTween.Kill();
    3.  
    to kill all tweens before quitting.
    If you're instead first destroying stuff and then quitting, you should call HOTween.Kill() as above, to clean everything correctly.
     
  17. Vevusio

    Vevusio

    Joined:
    Oct 13, 2013
    Messages:
    22
    nah i don't have a website, feel free to just re-upload it, if i make any changes i'll probably just post in this thread again
     
  18. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    Posting a link to your post then. You might want to open a full thread for it, so it will be easier to find if people search for it :)
     
  19. Sinfritz

    Sinfritz

    Joined:
    Nov 18, 2012
    Messages:
    72
    Is that necessary? I've been using HOTween for quite some time now and never call that...I figure it's done internally. Though I do stop all tweens whenever OnDestroy is called for behaviours that have them.

    [EDIT] Actually for me I call HOTween.Kill for each tween/sequence I create[/EDIT]
     
    Last edited: Jan 7, 2014
  20. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    @Sinfritz: Kill is better then stopping tweens, since that way you fully purge them, instead than just pausing them which still keeps them in memory. Calling Kill before the application quits instead is really not necessary, and if it's suddenly needed on iOS this should mean it's a recent Unity bug.
     
  21. username_

    username_

    Joined:
    Sep 27, 2013
    Messages:
    9
    Hello

    I have a tile based game in progress and wonder how to connect camera paths that are on separate tiles using hotween.
    Is it possible to define a path on a prefab and make it work properly?
    I have defined the path on the prefab(relative=true), but when I instantiate it, the path is at the wrong place(the end of the path is where the beginning should be, so the whole path is shifted).
    edit:
    here are some screenshots
     
    Last edited: Jan 9, 2014
  22. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    Hi,

    if you can create a barebone project that replicates this issue and send it to me, I'll check it out and see what's wrong.
     
  23. username_

    username_

    Joined:
    Sep 27, 2013
    Messages:
    9
    I've made a barebone project, and realized, that the path is jumping to the character that I'm moving on the path. It was just bad luck that the placing was exactly 1 tile away("the end of the path is where the beginning should be, so the whole path is shifted"). So the path's first node will shift to the character and execute it from there.
    I would like it the other way around. Is it possible? Or do I have to get the first node's position, and move my characther to it first?
    Thank you for your time!
     
    Last edited: Jan 9, 2014
  24. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    All HOTween's "logic" is that it will animate something from its current value to a custom one, and the path always "moves" from the current Transform's position to respect that. To avoid that, what you said is the way to go: manually move your transform to the first node and only then create/start the tween.
     
  25. username_

    username_

    Joined:
    Sep 27, 2013
    Messages:
    9
    Ok, thank you!
     
  26. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Messages:
    442
    Hi izitmee,

    I have question about HOTween:
    Let's say i have a simple screen with 3 buttons. Each button tweens in a new screen when pressed . When i press 2 buttons at the same time both screens tween in. How do i prevent that from happening and tween in only one screen? I know there is a function isTweening but that only checks one target from what i understand in the HOTween documents.

    Thx :)
     
  27. WingedS

    WingedS

    Joined:
    May 8, 2013
    Messages:
    19
    Hi Izitmee,

    Does isTweening or WaitForCompletion work for reverse/backwards?

    I was trying to do a coroutine using WaitForCompletion for reverse, but realized it didn't work. Then I tried a while (isTweening) { yield return null; } but realized isTweening returns false despite the fact that it's tweening backwards.

    Is it a bug or?
     
  28. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    @Tripwire: IsTweening should indeed be the way to go, if I understand correctly what you're trying to do. You can just pass it a screen as a target, and know if it's being tweened or not.

    @WingedS: WaitForCompletion doesn't work for reverse tweens, since at their end they're considered as rewinded and not as completed. About IsTweening, if it doesn't report reverse tweens it sounds like a bug. I'm superbusy this weekend, but will check it out next week.
     
  29. Superflat

    Superflat

    Joined:
    Mar 19, 2009
    Messages:
    354
    I'm having a small issue with the usage of OnComplete. Basically the variable i send along stops existing/get's overwritten when the OnComplete triggers.

    I have a for loop with a few things in there and i store the objects in the collection in a local var and pass this a long to the oncomplete.
    The loop finishes before the OnCompletes get there so the value's arent correct any more.

    How do i solve this?

    [Edit] Fixed it right now by not auto killing the tween and then just make a helper function to get the target from the tweener in the OnComplete with parameters
     
    Last edited: Jan 11, 2014
  30. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    I'm not sure I understood your issue, but as a tip, if you're using OnComplete with local vars, you can also use the wonderful lambdas (if you're using C# at least - I don't know if it's possible with UnityScript):
    Code (csharp):
    1.  
    2. int myLocalInt = 2;
    3. HOTween.To(myTransform, 2, new TweenParms()
    4.   .Prop("position", Vector3.zero)
    5.   .OnComplete(() => {
    6.     myLocalInt += 2;
    7.     Debug.Log(myLocalInt); // Logs 4
    8.   })
    9. );
    10.  
     
  31. WingedS

    WingedS

    Joined:
    May 8, 2013
    Messages:
    19
    I decided to use tweener.position != 0 to check if the reverse was completed instead.
     
  32. Superflat

    Superflat

    Joined:
    Mar 19, 2009
    Messages:
    354
    I'd loop through a list of gameobjects and in the loop i would pass .. say... collectionOfGOs[ someIndex ].. into the OnComplete()
    But that reference would change before the oncomplete would trigger and thus throw either an index of range or a null or something.

    On another note. There is a bug in the current visual editor where i click the 'Tween This' button and immediately the cancel button that pops up get's pressed as well. Rendering me unable to use the visual editor.
     
  33. chlagou

    chlagou

    Joined:
    Jan 15, 2014
    Messages:
    4
    Hi,
    I have nokia 920 wp8 gddr 2 ,when I deploy it
    visual studio 2012 show me this error

    at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
    at System.Activator.CreateInstance(Type type, Object[] args)
    at HOTweenManager.CreateTween(HOTweenData p_twData, Single p_globalDelay, Single p_globalTimeScale)
    at HOTweenComponent.Awake()
    at HOTweenComponent.UnityFastInvoke_Awake()


    A first chance exception of type 'System.ArgumentNullException' occurred in mscorlib.ni.dll
    An exception of type 'System.ArgumentNullException' occurred in mscorlib.ni.dll but was not handled in user code
    Exception: Value cannot be null.
    Parameter name: type
    Type: System.ArgumentNullException
    Module: mscorlib
    InnerException: <No Data>
    AdditionalInfo:<No Data>
    at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
    at System.Activator.CreateInstance(Type type, Object[] args)
    at HOTweenManager.CreateTween(HOTweenData p_twData, Single p_globalDelay, Single p_globalTimeScale)
    at HOTweenComponent.Awake()
    at HOTweenComponent.UnityFastInvoke_Awake()

    in HOTweenManager.cs
    foreach (HOPropData propData in p_twData.propDatas)
    {
    if (propData.isActive)
    {
    parms.Prop(propData.propName, Activator.CreateInstance(propData.pluginType, propData.endVal, propData.isRelative));
    }
    }

    I use Unity 4.3.3
     
  34. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    @Superflat: I hope I don't look too stupid, but I still don't understand completely your issue :p Could you write me the code you're using?
    About the Visual Editor bug, as soon as you click "Tween this" the panel should change, and you shouldn't be able to see the "Cancel" button anymore. What Unity version and OS are you using?

    @chalgou: that happens because the target of your tween is (or becomes while tweening) null. Also, are you using HOTweenMicro, which is necessary for WP8?
     
  35. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Messages:
    5,474
    Just wanted to pop in here and say a huge thanks!

    HOTween is pretty much my standard go to for tweening/animation and other things. I love the coding style and the way it is handled. (AS3 background as well). Very fast and flexible. Fantastic work!

    ZG
     
  36. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    Hey thanks a lot ZG: much appreciated :) Awesome avatar by the way (and great games too, there in your signature)!
     
  37. Superflat

    Superflat

    Joined:
    Mar 19, 2009
    Messages:
    354
    OSX, latest and latest unity. When i click Tween this, the panel changes and the cancel button underneath it, i think, consumes the same click.

    Using the right mouse button stops the problem from happening. left mouse doesnt.
     
    Last edited: Jan 16, 2014
  38. chlagou

    chlagou

    Joined:
    Jan 15, 2014
    Messages:
    4
    yep, I already using HotweenMicro.
    some tweens dont work on the device, I also use hotween Editor
     
  39. castor76

    castor76

    Joined:
    Dec 5, 2011
    Messages:
    775
    I have just moved on from iTween to Hotween and it has been alright so far.. And I would like to thank litzmee for sharing this.

    I would like to ask 2 things :

    1. Is there anywhere I can tween in local (self) space? I would like to say moveby in Z for 1 unit space, but I want it to be in local axis not in world axis.
    ( I can get around moving position by using Transform.TransformDirection but it would be much better if Hotween can natively handle this.

    2. When you look closely in profiler, you can see Hotween update call is generating considerable amount of memory towards GC. Can this be reduced / improved so that there are no more memory allocation during update call?

    The second point is really important as it can easily become 1k + per update call...

    Thanks!
     
  40. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    @Superflat: I can't replicate your issue (and also, the Cancel button shouldn't be under the Tween This one). If you have time, could you record a video of what's happening so I get a better idea?

    @chlagou: then I'd say the issue is that you're creating a tween of a property which doesn't exist (or is private or static).

    @castor76: Here you go:
    1. sure. You can tween any public non-static property, so you just have to tween the "localPosition" Prop instead than the "position" one.
    2. HOTween generates some GC, but has been optimized during this couple years and definitely doesn't generate that much. Maybe you're creating tons of tweens without realizing it?
     
  41. castor76

    castor76

    Joined:
    Dec 5, 2011
    Messages:
    775
    1. localPosition doesn't seem to work for me. It still moves in world axis. The self (local space) movement I am talking about is this : If I rotate my object 90 in Y axis, my local Z axis would be pointing at X world axis. But increasing local Z position doesn't translate object along X world axis but still in Z world axis. This happens even if I set inspector to debug mode and manually tweak localPosition value around. I think in order to do this properly, I need to parent it to another object, do the rotation on parent and then local translation on child. This clearly is not a good way to do it , because it would require 2 objects. Hence my work around (maybe this is the only way to do ) is use Transform.TransformDirection. What I am saying is that it would be nice if Hotween can support this as a parameter instead. Making things neat and nice. (like how iTween does it , less code)

    2. I am doing avarage of about 40 tweens. I can check this and confirm on my Tween instance. And it is doing about 1k GC each frame. Is this expected amount?
     
    Last edited: Jan 21, 2014
  42. kobilica

    kobilica

    Joined:
    Jan 4, 2014
    Messages:
    3
    HOTween looks very similiar to Greensock :D! (syntax style)
     
  43. kobilica

    kobilica

    Joined:
    Jan 4, 2014
    Messages:
    3
    Hello! I have problem, and that is that tweens are too fast, I write 30 secs and Tween completes in 12 secs.

    What to do? (Tested just in editor)
     
  44. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    @castor76: 1. Oh now I see what you meant. You could either use the 2 objects method, or simply calculate the appropriate ending point yourself. Adding this option to HOTween could be done, but right now I would have no time. Still, HOTween is open for custom plugins, so if you want to give it a try, all the code is on Google Code (plus an example custom plugin).
    About the GC issue, gonna investigate more in the future.

    @kobilica: Greensock is definitely my favorite tween engine ever :) I don't use it since ages, but when I made HOTween Greensock's syntax was completely different (even if the philosophy is the same, since I was indeed looking at it for inspiration). Did it change? I actually liked it as it was, and would've probably gone for something more similar if C# wasn't so (kind of) different.
    About the speed issue, I can assure that HOTween is super-precise. So either you have your project's timeScale set to 2.5, or you changed your Tweener/Sequence timeScale?
     
  45. Superflat

    Superflat

    Joined:
    Mar 19, 2009
    Messages:
    354
    It appears the window where you select tween targets comes up and disappears with certain classes
    If i select a regulat plane it'll work fine. But when i grab a GameObject that has something like EasyTouch attached to it, the window will close and not show up at all.
     
  46. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    Weird... maybe there's some conflict with classes names, though it seems like a different issue. If you can make a sample barebone project that replicates this issue (possibly without external plugins, if you manage) and send it to me I'll check it out.
     
  47. Superflat

    Superflat

    Joined:
    Mar 19, 2009
    Messages:
    354
    I'm not entirely sure how to do that. You're using reflection to get all the parameters right? Perhaps something is going wrong there that closes the window. NO errors in the editor however.
     
  48. Superflat

    Superflat

    Joined:
    Mar 19, 2009
    Messages:
    354
    By the way, while i have you. Can i setup sequences in the visual editor?
     
  49. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    New HOTween Update: v1.1.900

    - Fixed bug where using PartialPath the tween would stop at the first waypoint

    As usual, latest version is on HOTween's website.
     
  50. Izitmee

    Izitmee

    Joined:
    Jan 27, 2011
    Messages:
    3,207
    @Superflat: I suppose the error is in the Reflection, but I can't replicate it so I wouldn't know where to look. About the sample project, if you can create a simple project that gives you this error, and tell me what to do to replicate it, that would be the way to go :)
    About Sequences instead, nope, they're not available in the Visual Editor.