Unity Community


Page 3 of 79 FirstFirst 123451353 ... LastLast
Results 41 to 60 of 1579

  1. Location
    Chicago
    Posts
    859
    I second Himatako's suggestion. One thing I attempted to do with iTween was to use it for an FPS camera bobbing motion that was character speed dependent, but I was unable to adjust the 'bob' amount on the fly; iTween needs to finish what it's currently doing before a param can be adjusted.

    Having the abillity to have constant motion every frame with all subsequent eases and be able to adjust this smoothly on the fly, mid-tween, for greater or lesser motion, would be ideal.

    Good stuff here Izitmee.
    Steve Bodnar - Animation Director
    FlipFrame Animation/Games

    Recent Project - Bioshock Infinite
    Current Project - 'Unreleased'
    -------------------------------------------------
    Unity3D Pro / iOS Pro


  2. Location
    Rome / Niš
    Posts
    1,754
    @himatako: oops! Actually, strings should be able to be tweened by default, without using a plugin. Just added this option and it will be available in the next update (with those other options).

    @SteveB: what you're suggesting looks like an interesting addition to what Himatako said, I'll try to add it too. As of now, I planned to add the possibility of changing easing, loops, etc. on the fly, but not the "end value" to reach, which instead I suppose you're referring to. I'll definitely look into it within the week (right now I'm totally stuck into allowing tweens to animate with constant speed along a Catmull-Rom path: I thought I contrived a kind of inexpensive and fast way to do it, but though the logics and implementation look correct, it's not working :P).
    P.S. hey it's an honor to see you checking HOTween, seeing your incredible curriculum

    ::::: GOSCURRY - a hard game :::::

    I am DEMIGIANT
    HOTween : a fast, type-safe, and powerful Unity tween engine
    HOTools - HOUnityLibs


  3. Location
    Sintra, Portugal
    Posts
    669
    Is the OSX version ready for primetime yet?


  4. Location
    Rome / Niš
    Posts
    1,754
    Quote Originally Posted by 24pfilms View Post
    Is the OSX version ready for primetime yet?
    zcycool and apparition used it on OSX, and it gave them no problems. Seen that HOTween's DLL is just an assembly, it works both with Windows than with Mac

    ::::: GOSCURRY - a hard game :::::

    I am DEMIGIANT
    HOTween : a fast, type-safe, and powerful Unity tween engine
    HOTools - HOUnityLibs


  5. Posts
    79
    Hey guys, just found this as I was looking for a way to replace iTween due to so many Destroys() slowing down my game on android.
    I really just got into it and am wondering if there is a way to see the code that the visual editor creates? I am pretty sure this was asked about already in the thread but I didnt see a answer.. might have just missed it since I am distracted at work lol

    That would make it super simple to learn it


  6. Posts
    79
    Ok, Now I have some questions

    I am trying to make a count down timer to start my game.. I tried 2 different methods neither of which I could get to work correctly.. here is what I tried

    First I tried using OnCompletes
    Code:  
    1. void startCountDown()
    2.     {
    3.         if(doCountDown)
    4.         {
    5.             HOTween.To(numParent.transform, 1, new TweenParms().Prop("position", new Vector3(16,countDownYonScreen,-92)).OnComplete(countDownThreesLocal));
    6.         }
    7.     }
    8.    
    9.     public static void countDownThreesLocal()
    10.     {
    11.         HOTween.To(numThree.transform, 1, new TweenParms().Prop("localScale", Vector3.one).OnComplete(countDownTwosLocal));
    12.     }
    13.    
    14.     void countDownTwosLocal()
    15.     {
    16.         numThree.transform.localScale = Vector3.zero;
    17.         HOTween.To(numTwo.transform, 1, new TweenParms().Prop("localScale", Vector3.one).OnComplete(countDownOnesLocal));
    18.  
    19.     }
    20.    
    21.     void countDownOnesLocal()
    22.     {   
    23.         numTwo.transform.localScale = Vector3.zero;
    24.         HOTween.To(numOne.transform, 1, new TweenParms().Prop("localScale", Vector3.one).OnComplete(countDownDoneLocal));
    25.     }
    26. void countDownDoneLocal()
    27.     {   
    28.         print("COUNT DOWN DONE!");
    29.         numOne.transform.localScale = Vector3.zero;
    30.         HOTween.To(numParent.transform, 1, "position", new Vector3(16,countDownYoffScreen,-92));
    31.     }

    When I do it this way, each number scales up twice. Three scales up then down, then two and three scale up then down, then two and one, then one.


    then I tried using a sequence
    Code:  
    1. void startCountDown()
    2.     {
    3.         if(doCountDown)
    4.         {
    5.             //countDown sequence
    6.             Sequence theCountDown = new Sequence(new SequenceParms().OnComplete(countDownDoneLocal));
    7.            
    8.             theCountDown.Append(HOTween.To(numParent.transform, 0.01f, "position", new Vector3(16,countDownYonScreen,-92)));
    9.             theCountDown.Append(HOTween.To(numThree.transform, 0.99f, "localScale", Vector3.one));
    10.             theCountDown.Append(HOTween.To(numThree.transform, 0.01f, "localScale", Vector3.zero));
    11.             theCountDown.Append(HOTween.To(numTwo.transform, 0.99f, "localScale", Vector3.one));
    12.             theCountDown.Append(HOTween.To(numTwo.transform, 0.01f, "localScale", Vector3.zero));
    13.             theCountDown.Append(HOTween.To(numOne.transform, 0.99f, "localScale", Vector3.one));
    14.             theCountDown.Append(HOTween.To(numOne.transform, 0.01f, "localScale", Vector3.zero));
    15.             theCountDown.Append(HOTween.To(numParent.transform, 0.01f, "position", new Vector3(16,countDownYoffScreen,-92)));
    16.            
    17.             theCountDown.Play();
    18.         }
    19.     }
    20.  
    21.  
    22. void countDownDoneLocal()
    23.     {   
    24.         print("COUNT DOWN DONE!");
    25.     }

    this has the same type of effect.. numThree scales up, then resets to zero, then when numTwo scale up, numThree scale up again. This happens for all numbers and calls the OnComplete twice at the end.


  7. Location
    Rome / Niš
    Posts
    1,754
    Hey ShreddinPB, glad you're trying HOTween

    In your example, Sequence is definitely the way to go. I tested it out, and it works perfectly: are you sure that "startCountDown" is not called multiple times? I built a working sample, using exactly your code, and everything runs as expected.

    You can get the UnityPackage with the sample "Counter" scene I created to test it out here (HOTween DLL is not included, you will have to add it, or just import the package in your current project). I used your code, and placed it inside "CounterBrain.cs", which is a MonoBehaviour attached to the empty gameObject "_Brain", and I used colored cubes instead of numbers to do it more quickly (I have to rush to get a plane).

    About the Visual Editor, it is not a code generator (and nope, nobody asked that question yet), thus there's no way to see its output. But I might create a visual helper that does that.

    Also, I'm sorry but I'm leaving now and will be travelling for two days, thus I'll be back to the forums only on thursday (timezone is GMT+1) :P
    Last edited by Izitmee; 01-24-2012 at 01:56 AM.

    ::::: GOSCURRY - a hard game :::::

    I am DEMIGIANT
    HOTween : a fast, type-safe, and powerful Unity tween engine
    HOTools - HOUnityLibs


  8. Posts
    118
    Thank you very much Izitmee and Himatako
    I'm going to check it out hope i#ll get it to work with my less coding skills lol
    great that you responded that fast and detailed!


  9. Posts
    79
    Quote Originally Posted by Izitmee View Post
    Hey ShreddinPB, glad you're trying HOTween

    In your example, Sequence is definitely the way to go. I tested it out, and it works perfectly: are you sure that "startCountDown" is not called multiple times? I built a working sample, using exactly your code, and everything runs as expected.

    You can get the UnityPackage with the sample "Counter" scene I created to test it out here (HOTween DLL is not included, you will have to add it, or just import the package in your current project). I used your code, and placed it inside "CounterBrain.cs", which is a MonoBehaviour attached to the empty gameObject "_Brain", and I used colored cubes instead of numbers to do it more quickly (I have to rush to get a plane).

    About the Visual Editor, it is not a code generator (and nope, nobody asked that question yet), thus there's no way to see its output. But I might create a visual helper that does that.

    Also, I'm sorry but I'm leaving now and will be travelling for two days, thus I'll be back to the forums only on thursday (timezone is GMT+1) :P
    There is no need to be sorry!
    I will double check everything then, when I was using iTween it wasnt getting called twice (or wasnt acting like it was) so I assumed it was only calling once.. I will trace and find out where my code is wrong!

    Thanks for looking into it!
    Have a great trip


  10. Location
    Rome / Niš
    Posts
    1,754
    New update (v0.8.006)

    • You can animate with constant speed along a path (chaining the ConstantSpeed parameter on the PlugVector3Path plugin).
    • You can make speed-based instead than time-based tweens (chaining the SpeedBased parameter on TweenParms).
    • String properties can be animated using defaults (meaning they don't need PlugString to be used directly).


    Now moving to the implementation of runtime parameter changings.

    P.S. ShreddinPB, the trip was terrible, but now that I arrived I'm happy Let me know if you find what was wrong or if you need more help.

    ::::: GOSCURRY - a hard game :::::

    I am DEMIGIANT
    HOTween : a fast, type-safe, and powerful Unity tween engine
    HOTools - HOUnityLibs


  11. Posts
    79
    Quote Originally Posted by Izitmee View Post
    New update (v0.8.006)

    • You can animate with constant speed along a path (chaining the ConstantSpeed parameter on the PlugVector3Path plugin).
    • You can make speed-based instead than time-based tweens (chaining the SpeedBased parameter on TweenParms).
    • String properties can be animated using defaults (meaning they don't need PlugString to be used directly).


    Now moving to the implementation of runtime parameter changings.

    P.S. ShreddinPB, the trip was terrible, but now that I arrived I'm happy Let me know if you find what was wrong or if you need more help.
    Damn! Im sorry to hear the trip sucked, but cool that the final result is good

    Yeah. I got it to work, there was a little bump in the road tho.
    In my head, setting up the sequence was just setting it up, and not playing it.. so since it automatically plays I was a bit confused. I just added a Pause() after all the Append()s and then just called Play() when I needed it to play.

    Code:  
    1. using UnityEngine;
    2. using System.Collections;
    3. using Holoville.HOTween;
    4. using Holoville.HOTween.Plugins;
    5.  
    6. public class sequencedCountdown : MonoBehaviour {
    7.    
    8.     public GameObject numbersParent;
    9.     public GameObject numOne;
    10.     public GameObject numTwo;
    11.     public GameObject numThree;
    12.    
    13.     int countDownScaleTo = 1;
    14.     public static int countDownYonScreen = 200;
    15.     public static int countDownYoffScreen = -38;
    16.    
    17.     public static Sequence theCountDown;
    18.    
    19.     void Start()
    20.     {
    21.         theCountDown = new Sequence(new SequenceParms().OnComplete(countDownDoneLocal));
    22.         theCountDown.Append(HOTween.To(numbersParent.transform, 0.01f, "position", new Vector3(16,countDownYonScreen,-92)));
    23.         theCountDown.Append(HOTween.To(numThree.transform, 0.99f, "localScale", Vector3.one));
    24.         theCountDown.Append(HOTween.To(numThree.transform, 0.01f, "localScale", Vector3.zero));
    25.         theCountDown.Append(HOTween.To(numTwo.transform, 0.99f, "localScale", Vector3.one));
    26.         theCountDown.Append(HOTween.To(numTwo.transform, 0.01f, "localScale", Vector3.zero));
    27.         theCountDown.Append(HOTween.To(numOne.transform, 0.99f, "localScale", Vector3.one));
    28.         theCountDown.Append(HOTween.To(numOne.transform, 0.01f, "localScale", Vector3.zero));
    29.         theCountDown.Append(HOTween.To(numbersParent.transform, 0.01f, "position", new Vector3(16,countDownYoffScreen,-92)));
    30.         theCountDown.Pause();
    31.     }
    32.    
    33.     public static void Play()
    34.     {
    35.         theCountDown.Play();
    36.     }
    37.    
    38.     public static void countDownDoneLocal()
    39.     {   
    40.         levelAimer.okToShoot = true;
    41.         doMoveDown.startLevelTimer = true;
    42.     }
    43.    
    44. }


  12. Posts
    79
    I do have another question if you have a minute.

    In my game, the objects you are going to lob are lined up on a path. Lob your object and the others on the que path will shift forward like they are stacked up on the path.

    I searched around and am having trouble figuring this out
    I am having a hard time figuring any of it out hahahaha

    How do I create a path?
    How do I animate along that path, but just to a certain point along the path, like move from 50% of the way to 60% of the way?

    As much as it seems I am asking you to just write it, I really am not lol just with no working example that I can find of how the path animation system works, I cant pick it apart and figure it out


  13. Location
    Rome / Niš
    Posts
    1,754
    Quote Originally Posted by ShreddinPB View Post
    How do I create a path?
    To create a path, you just store an Array of Vector3 points, and then use PlugVector3Path to animate it. I just created an example (Path Basics) on HOTween's website, so you can download it and see how it works

    Quote Originally Posted by ShreddinPB View Post
    How do I animate along that path, but just to a certain point along the path, like move from 50% of the way to 60% of the way?
    When you animate on a path, the tween moves along the whole path (though what you're asking is quite interesting, I will see if I can add a "partial tween" option in the near future). But you can "jump" to a position in time using GoTo or GoToAndPlay, and then use the OnUpdate callback to do something when it goes beyond a certain time position:
    Code:  
    1. using UnityEngine;
    2. using Holoville.HOTween;
    3. using Holoville.HOTween.Plugins;
    4.  
    5. /// <summary>
    6. /// Attach this class to an empty gameObject in the scene.
    7. /// </summary>
    8. public class Sample : MonoBehaviour
    9. {
    10.     public      Transform           myTransform; // Attach a transform here via inspector.
    11.     public      Vector3[]           myPath = new Vector3[4] { new Vector3(0,0,0), new Vector3(5,0,0), new Vector3(5,5,0), new Vector3(-10,5,0) };
    12.    
    13.     private     IHOTweenComponent   tweener;
    14.    
    15.    
    16.     void Start()
    17.     {
    18.         tweener = HOTween.To( myTransform, 2, new TweenParms().Prop( "position", new PlugVector3Path( myPath ) ).OnUpdate( PathUpdate ) );
    19.         // Jump to 50% time position (1).
    20.         // GoTo moves to the given position and doesn't change the play mode
    21.         // (meaning the tween will goto and play if it was playing, or goto and pause if it was paused).
    22.         tweener.GoTo( 1 );
    23.        
    24.         // I add this to show the path in the Editor (if the Gizmos button is selected).
    25.         HOTween.showPathGizmos = true;
    26.     }
    27.     void PathUpdate()
    28.     {
    29.         if ( tweener.position >= 1.2f ) {
    30.             // If the time position is higher than 60% (1.2) of the duration,
    31.             // move back to 50% duration and go on playing.
    32.             // This will create an infinite loop between 50% and 60% time position.
    33.             tweener.GoTo( 1 );
    34.         }
    35.     }
    36. }
    Note that in the above code I stored the tweener as an IHOTweenComponent instead than as a Tweener: IHOTweenComponent is an interface which you can use both for Tweeners than for Sequences, thus controlling them (with GoTo and other methods) in the same way.

    P.S. what you said about Sequence sounds totally right... Tomorrow I will probably change its behaviour so that it doesn't start automatically anymore

    ::::: GOSCURRY - a hard game :::::

    I am DEMIGIANT
    HOTween : a fast, type-safe, and powerful Unity tween engine
    HOTools - HOUnityLibs


  14. Posts
    79
    Quote Originally Posted by Izitmee View Post
    To create a path, you just store an Array of Vector3 points, and then use PlugVector3Path to animate it. I just created an example (Path Basics) on HOTween's website, so you can download it and see how it works


    When you animate on a path, the tween moves along the whole path (though what you're asking is quite interesting, I will see if I can add a "partial tween" option in the near future). But you can "jump" to a position in time using GoTo or GoToAndPlay, and then use the OnUpdate callback to do something when it goes beyond a certain time position:
    Code:  
    1. using UnityEngine;
    2. using Holoville.HOTween;
    3. using Holoville.HOTween.Plugins;
    4.  
    5. /// <summary>
    6. /// Attach this class to an empty gameObject in the scene.
    7. /// </summary>
    8. public class Sample : MonoBehaviour
    9. {
    10.     public      Transform           myTransform; // Attach a transform here via inspector.
    11.     public      Vector3[]           myPath = new Vector3[4] { new Vector3(0,0,0), new Vector3(5,0,0), new Vector3(5,5,0), new Vector3(-10,5,0) };
    12.    
    13.     private     IHOTweenComponent   tweener;
    14.    
    15.    
    16.     void Start()
    17.     {
    18.         tweener = HOTween.To( myTransform, 2, new TweenParms().Prop( "position", new PlugVector3Path( myPath ) ).OnUpdate( PathUpdate ) );
    19.         // Jump to 50% time position (1).
    20.         // GoTo moves to the given position and doesn't change the play mode
    21.         // (meaning the tween will goto and play if it was playing, or goto and pause if it was paused).
    22.         tweener.GoTo( 1 );
    23.        
    24.         // I add this to show the path in the Editor (if the Gizmos button is selected).
    25.         HOTween.showPathGizmos = true;
    26.     }
    27.     void PathUpdate()
    28.     {
    29.         if ( tweener.position >= 1.2f ) {
    30.             // If the time position is higher than 60% (1.2) of the duration,
    31.             // move back to 50% duration and go on playing.
    32.             // This will create an infinite loop between 50% and 60% time position.
    33.             tweener.GoTo( 1 );
    34.         }
    35.     }
    36. }
    Note that in the above code I stored the tweener as an IHOTweenComponent instead than as a Tweener: IHOTweenComponent is an interface which you can use both for Tweeners than for Sequences, thus controlling them (with GoTo and other methods) in the same way.

    P.S. what you said about Sequence sounds totally right... Tomorrow I will probably change its behaviour so that it doesn't start automatically anymore
    That totally rocks! I can work with that.. I just tested and can use Pause() on it also.. so I can set it to pause when it gets to a certain point, then play again when I need it to move

    But yeah, being able to just set a distance along the curve to move to would be great.. possibly to the parametric length 0.5 half way, something like that

    Cool, glad I can contribute some ideas

    as a note, when I go to the link for your examples http://www.holoville.com/hotween/examples.html it just says "Coming Soon!"


  15. Location
    Los Angeles
    Posts
    30
    Hi Izitmee,

    Just wanted to let you know I'm using HOTween in my new project, and it's really fantastic. It's a bit challenging to figure out how to manually execute some of the stuff iTween does automatically with all it's methods, but it's worth it because you have way more control over your code, and there are no Hashes!

    I wish there was some way around having to use a string in Prop, but it's easy enough to just pop the hints up for whatever script you are trying to tween.

    Keep up the great work!


  16. Location
    Rome / Niš
    Posts
    1,754
    Quote Originally Posted by ShreddinPB View Post
    when I go to the link for your examples http://www.holoville.com/hotween/examples.html it just says "Coming Soon!"
    Ooops, sorry, that's a cache issue. If you press refresh on your browser the example should magically appear

    @Smorpheus: thanks a lot for letting me know, I'm very glad you're liking it I tried all possible hacks not to use a string to define the property to tween, but that was truly impossible (unless, maybe, I'd decide to go with "unsafe" code, but that's a thing I definitely want to avoid).

    P.S. 8-bit RPG hooked me! Just seeing those characters made me hunger for it

    ::::: GOSCURRY - a hard game :::::

    I am DEMIGIANT
    HOTween : a fast, type-safe, and powerful Unity tween engine
    HOTools - HOUnityLibs


  17. Location
    Rome / Niš
    Posts
    1,754
    Just a quick update (v0.8.007), which I thought I'd mention because of some changes:

    The ConstantSpeed parameter I introduced yesterday for paths doesn't exist anymore. This doesn't mean that it doesn't work anymore, but simply that it's now used by default (I realized that there's no use in moving along a curved path without constant speed, thus the parameter was futile).

    As rightfully suggested by ShreddinPB, Sequences are now created in a paused state, and you will need to call mySequence.Play() to start them.

    As usual, you can get it all on HOTween's website.

    ::::: GOSCURRY - a hard game :::::

    I am DEMIGIANT
    HOTween : a fast, type-safe, and powerful Unity tween engine
    HOTools - HOUnityLibs


  18. Posts
    79
    Hey man, not sure if I am doing something wrong, or if its a bug.
    I downloaded the newest update and copied it over.

    When I use the path, a fresh setup or even running the script you posted, there seems to be an extra Vector3 in there.
    So in your example you have a vector3 array of 4.. in the editor the path has 5 points
    my one I made has 10, but when it plays there is an 11th point that isnt along the path at all.. it seems to be at 0,0,0


  19. Location
    Rome / Niš
    Posts
    1,754
    Hey, just tried to replicate the issue, even using the script I posted, but I can find no additional points.

    Consider that, if the target position doesn't coincide with the first path point, HOTween automatically adds a curve leading from the target's position to the beginning of the path. Maybe that is what you're seeing?

    ::::: GOSCURRY - a hard game :::::

    I am DEMIGIANT
    HOTween : a fast, type-safe, and powerful Unity tween engine
    HOTools - HOUnityLibs


  20. Location
    Thailand
    Posts
    179
    Since I need an alert box, so I decided to quickly code an alert box with HOTween. Hopefully this can be useful, as well as showing how HOTween can be used easily with UnityGUI.

    Alert Box with HOTween

Page 3 of 79 FirstFirst 123451353 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •