Hello everyone, I’m releasing today my iTween Visual Editor for Unity 3. You can read all about what it can do and download it here. The short version is that you can take a GameObject, attach an iTweenEvent to it and then using the custom editor set up the tween properties and you get all the power and flexibility of iTween with zero code required. It’s all free as in both beer and speech, licensed under the MIT license so I’d appreciate any feedback or suggestions (or improvements!).
Well I thought I could figure it out But Still no luck
I tried this:
function Update ()
{
if(Input.GetKeyDown("a"))
{
iTween.Stop();
print("A is stopped");
//iTween.Resume(gameObject);
}
if(Input.GetKeyUp("a"))
{
iTween.Resume();
print("A is now active");
}
}
But dont know how to call the tweens That were created with the Tween Editor?
The documentation on iTween says when using key presses add a stop and then any new iTweens after that, but that means the ones in the Editor are deleted?
Hmm… Yeah I cant figure out how to make the connection. Is there any smart fellas out there that know how to call the Itween Events created with the Visual iTween Editor from a script?
I thought if I did something like below it would work but Just not sure how to call iTween to play tweens that are on the object and Play Automatically is turned off?
function Update ()
{
if(Input.GetKeyDown("a"))
{
iTween.Resume(gameObject);
}
}
Hi,
Thank you for this brilliant tool, i hadn’t tried iTween before today and your editor sold it to me in second !
How do you exactly trigger an event in code if i uncheck the play auto box ? I don’t get it even with your post above ?
I get errors when using this code :
// Update is called once per frame
void Update ()
{
if(Input.GetButtonDown("Horizontal"))
{
iTween();
}
}
What if i put multiples iTweenEvents on a gameObject and want to trigger by code only one of them on a reason, more than one on another reason ? Is it possible to distinguish each iTweenEvents attach to a gameObject in the code ?
Version 0.2 is out which adds the ability to use the path parameter of the MoveTo and MoveFrom. Also, adds in the ability to use the callback functionality of iTween.
Attached is an example of triggering a tween that is set to not play automatically via code. In this case, clicking on the sphere starts the tween on the box.
In that example, if you had multiple tweens on your box and you wanted to trigger a specific one, you could use GetComponents instead of GetComponent and iterate through the iTweenEvent objects, checking the type property of each one until you find the one you want. That assumes you can distinguish between events via type. If you have multiple tweens of the same type that you want to trigger then we’d have to figure something else out. I suppose I could add a name variable to the iTweenEvent if people would find that useful.