Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Daniel G · Jul 24, 2013 at 02:14 AM ·

iTween Visual Editor, Help!

Hello, I would like to be able to add iTween event using visual editor, and on that iTween Event set a parameter and target game object that says when this animation is completed start the animation on the other game object.

WHAT AM I DOING WRONG:
Obj A has a iTweenEvent with >> iTween Visual Editor NOT CODED SCRIPT on it that has this checked: oncomplete: (name of Obj B's iTweenEvent Visual Inspector Script), and Obj A also has this checked: oncompletetarget: (Transform of Obj B, that has the NEXT animation on it I want to start as SOON as Obj A's animation is complete).

Picture of Obj A's iTween Visual Editor Inspector Script:

alt text

Picture of Obj B's iTween Visual Editor Inspector Script:

alt text

Thanks for the Help Daniel

PS: I take the time to Mark and rate all good answers!

obj b!!.png (90.5 kB)
obj a!!.png (91.8 kB)
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Daniel G · Jul 24, 2013 at 02:21 AM 0
Share

PS: I have read all documentation But there is NO documentation for the Visual Editor! I Although the same Principles $$anonymous$$UST carry over I don't understand the logic in Callbacks either So any help with Logic would GREATLY be appreciated!

avatar image Daniel G · Jul 24, 2013 at 02:36 AM 0
Share

@aldonaletto I don't expect you to answer this question, but I know you love progra$$anonymous$$g and have helped me in the past! If you have a $$anonymous$$ute, and can understand my mutilated way of using iTween and show me how to do it right! I would me much obliged!

avatar image Daniel G · Jul 24, 2013 at 01:44 PM 0
Share

Hello, is there any one with experience with iTween that could give me some pointers?

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Daniel G · Jul 24, 2013 at 04:07 PM

Hello Everyone! So I know this question will be asked again by someone using iTween Visual Editor, so I like to take a second to clear up any confusion when using callbacks with iTween Visual Editor.

  1. the callbacks that are listed in the iTween visual editor are for naming a message and giving it a value that is sent to all GameObjects in the hierarchy and if one of those GameObjects has a script attached to it that WANTS that oncomplete "callBack" or onupdate "CallBack" then it can trigger that OTHER functions separate from iTween OR call more iTween events!

  2. So if your looking for a way to call another animation OR other functions in your game here is how you do it!

First Set up a iTween Visual Editor component on the game object you want to animate:

Like so:

alt text

THEN Check oncomplete and give it a value such as "LoopAnimationAgain" THIS will be your function in your script! THEN IF it is a dieffernt game object that your script will be resting, THEN drag that OTHER game obj into the oncompletetarget area (check it first) THEN DIFINE a Parameter! This is like a VALUE for that FUNCTION! SO in my script i am attaching below, you can set that as the method : String! And if you wanted you could have SEVERAL methods (Methods = the VALUE for the Function).

Case is a specific VALUE of the FUNCTION. WHEN that VALUE or Case or Method (all the same thing) is sent FROM the iTween Visual Editor script (see picture above), it will Trigger the (coded) script on the other GameObject to DO SOMETHING! Here is the Example! This is STRIPPED from my code for my PlayButton:

Code:

 //For animation of LoadingScreen
 var TriangleTwist : GameObject;
 var TriangleOne : GameObject;
 var TriangleTwo : GameObject;
 var TriangleThree : GameObject;
 var TriangleFour : GameObject;
 var LoadingGUIAnimationStartWaitTime : float = 0;
 
 function Start () {
 
 }
 
 function Update () {
     LoadingAnimation ();
 }
 
 
 function LoadingAnimation () {
     pb = GameObject.FindGameObjectWithTag("PlayButton").gameObject.GetComponent(playButton);
     
     //For testing...
     //if (Input.GetKeyDown("space")) {
     if (pb.tappedOn == true) {
     
         Debug.Log("Input Works!");
         yield WaitForSeconds (LoadingGUIAnimationStartWaitTime);
         //Start Movement of GUI loading animation and triangle animation into view of LoadingScreen_CAM
         
         iTweenEvent.GetEvent(TriangleTwist, "MoveUp").Play();
         iTweenEvent.GetEvent(CubeBottom, "MoveUp").Play();
         iTweenEvent.GetEvent(CubeTop, "MoveDown").Play();
         iTweenEvent.GetEvent(TriangleTwist, "LoadingAnimationTwirl").Play();
         iTweenEvent.GetEvent(TriangleOne, "ColorFadeToWhite").Play();
         iTweenEvent.GetEvent(TriangleTwo, "ColorFadeToWhite").Play();
         iTweenEvent.GetEvent(TriangleThree, "ColorFadeToWhite").Play();
         iTweenEvent.GetEvent(TriangleFour, "ColorFadeToWhite").Play();
         iTweenEvent.GetEvent(TriangleOne, "ColorFadeToGrey").Play();
         iTweenEvent.GetEvent(TriangleTwo, "ColorFadeToGrey").Play();
         iTweenEvent.GetEvent(TriangleThree, "ColorFadeToGrey").Play();
         iTweenEvent.GetEvent(TriangleFour, "ColorFadeToGrey").Play();
     }
 }
         
         //This "LoopAnimationAgain" = the ONCOMPLETE call from the "TriangleTwist" GameObject that HAS the iTween Event with the oncompleteparams METHOD on in and when the method is called such as "StartLoop"
         // it replays all the iTween Events!
 function LoopAnimationAgain (method : String) {
 switch(method){
         case "StartLoop":
         Debug.Log("THIS WORKS!!");
         iTweenEvent.GetEvent(TriangleTwist, "LoadingAnimationTwirl").Play();
         iTweenEvent.GetEvent(TriangleOne, "ColorFadeToWhite").Play();
         iTweenEvent.GetEvent(TriangleTwo, "ColorFadeToWhite").Play();
         iTweenEvent.GetEvent(TriangleThree, "ColorFadeToWhite").Play();
         iTweenEvent.GetEvent(TriangleFour, "ColorFadeToWhite").Play();
         iTweenEvent.GetEvent(TriangleOne, "ColorFadeToGrey").Play();
         iTweenEvent.GetEvent(TriangleTwo, "ColorFadeToGrey").Play();
         iTweenEvent.GetEvent(TriangleThree, "ColorFadeToGrey").Play();
         iTweenEvent.GetEvent(TriangleFour, "ColorFadeToGrey").Play();
         break;
         
         //You can Have MORE cases if you want with different Values!
         //case "BlahBlah"
             //Do more things here like move something or call an iTweem animation
         //break; REMEMBER to BREAK; the CALL otherwise it will call every frame!
     }
 }



Hope this Helps EveryOne out there! Daniel G


screen shot 2013-07-24 at 11.50.33 am.png (123.6 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Using private class strings with iTween event calls 0 Answers

UnityEngine.Input.GetMouseButton(1)) issue 1 Answer

where can i find tutorials 1 Answer

I made a better shader how do i fix[add _Shadow Strength]help???>Sorry that im asking for to much 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges