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
-2
Question by Daniel 8 · Jun 28, 2010 at 12:08 PM · flagged-for-close

How do i loop my script so it continuously does what is inside it?

Possible Duplicate:
How to go from the bottom of your script back to the top in game?

function Start () { iTween.moveTo(gameObject, {"z":-11.5, "time": 2, "transition":"easeInOutExpo", "onComplete":"Rotate1" }); }

function Rotate1(){ iTween.rotateTo(gameObject, {"x":180, "time": 2, "onComplete": "MoveBack"}); }

function MoveBack() { iTween.moveTo(gameObject, { "z":-4.5, "time": 2, "transition":"easeInOutExpo", "onComplete": "Rotate2"} ); }

function Rotate2(){ iTween.rotateTo(gameObject, {"x":-180, "time": 2}); }

I want it to go from the end of

Comment
Add comment · Show 7
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 Murcho · Jun 28, 2010 at 12:44 PM 0
Share

Not really straight forward. Actually makes no sense.

What do you mean? I read this as "$$anonymous$$y script is in use and I want to get it back to the top" The top of what? You don't move scripts, what is the script?

avatar image Daniel 8 · Jun 28, 2010 at 01:23 PM 0
Share

All i want is it do read my script, which has it doing 3 animations and then when it gets to the last animation go back up to the top and start all 3 animations again. And the top of what? The top of the script.

avatar image Stanislav Pugach · Jun 28, 2010 at 02:21 PM 0
Share

You could start by quoting your script in your question so that it is possible to understand what you are asking about. You can snip most of the animations to keep the size manageable

avatar image Cyclops · Jun 28, 2010 at 03:45 PM 0
Share

Duplicate of http://answers.unity3d.com/questions/13798/how-to-go-from-the-bottom-of-your-script-back-to-the-top-in-game .

avatar image Cyclops · Jun 28, 2010 at 03:48 PM 0
Share

@$$anonymous$$, please don't post duplicate Questions - if you don't understand the Answer, edit your original Question or post a comment to the Answer.

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Peter G · Jun 28, 2010 at 01:29 PM

Sounds like you want a loop. This is similar, almost identical to the system used by the AI in the FPS tutorial.

//JS function Start() { RepeatLoop (); }

function RepeatLoop () { while(true) { //do all your animation stuff here. //you might have to use coroutines to yield the result.

    yield;
 }

}

Comment
Add comment · Show 1 · 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
avatar image Daniel 8 · Jun 29, 2010 at 01:47 AM 0
Share

it says i need to add a : ins$$anonymous$$d of a ; but then i get 4 more errors? This just doesnt make sense!

avatar image
0

Answer by pixelplacement · Jul 19, 2010 at 05:20 AM

You need to chain iTweens with the delay property. Please take a look at the hello world complex example I have provided on the support page.

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

No one has followed this question yet.

Related Questions

Where can I learn to script in Unity? 1 Answer

Ground Plane when starting new project 1 Answer

unity text -- 1 Answer

How to make a "cinematic" Intro 1 Answer

frame only 0 Answers


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