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 missypooh · Mar 03, 2012 at 06:19 PM · animationanimationclip

Create animation that allow picture to come in one by one

I would like to ask some questions regarding the animation. I will have 10 pictures in the beginning of the scene. Instead of making it static (when the scene started, it just display all the 10 pictures), i would like to make some special effect/animation to the picture. For example like make them march in one by one. So i would like to ask if i have to do animation for all the 10 picture or i can just do one and control via the scripting? Any suggestion? thank you

Comment
Add comment · Show 2
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 Meltdown · Mar 03, 2012 at 07:32 PM 0
Share

Is the 10 pictures making up your marching animation? Or do you want 10 seperate pictures to move into your scene?

avatar image missypooh · Mar 04, 2012 at 01:50 AM 0
Share

10 pictures making up the marching animation.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Berenger · Mar 04, 2012 at 12:21 AM

Use InvokeRepeating, or a coroutine, to iterate inside an array of Texture2D.

Comment
Add comment · Show 6 · 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 missypooh · Mar 04, 2012 at 01:51 AM 0
Share

i would appreciate if you could provide more details?

avatar image Berenger · Mar 04, 2012 at 02:02 AM 0
Share

Sure. First, create an array of Texture2D that you can fill inside the inspector, and the index we'll use later.

var slides : Texture2D;
private var index : int = 0;

Then, the coroutine which iterate index every x secondes

function Start(){
    while( index < slides.Length ){
        yield WaitForSeconds( x );
        index++;
    }
}

Finally, display the corresponding texture

function OnGUI(){
    GUI.DrawTexture( Rect( 0, 0, Screen.width, Screen.height ), slides[index] );
}
avatar image missypooh · Mar 04, 2012 at 04:29 AM 0
Share

thank you. i will try it out. But i don't understand, you mention need to call coroutine and iterate index every x seconds, where should i place the coroutine function?

avatar image Berenger · Mar 04, 2012 at 04:37 AM 0
Share

I wrote "call a coroutine", noticed the mistake and edited, but it takes time to update. The coroutine here is Start. A coroutine is, to make it simple, a function that have a yield instruction, which stop the execution for some time. So you don't need to call it, it's the usual Start function, Unity will call it.

avatar image missypooh · Mar 04, 2012 at 08:57 AM 0
Share

thank you. I was wondering how come not using Coroutine(). Anyway to add on some question, for example, i have 10 picture static on the scene, so after 10second, i will start playing animation on picture1, and after 20 second i will start playing animation on picture 2, after 30 second on picture3... how can i tackle this kind of thing?

Show more comments

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

6 People are following this question.

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

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Trying to check what anim clip is currently running on object 1 Answer

Empty animation clips when copying to Prefab 1 Answer

How can I reassign animation curves to play on a child object (instead of through parent)? 1 Answer

Can't Animate 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