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 joe 7 · Jan 19, 2011 at 02:19 AM · animationmainmenu

main menu animation

what i want to happen is when you click the play button, an animation will play and when its done the frist level will load. if you could script that in java script that would be great!

Comment
Add comment · Show 5
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 DaveA · Jan 19, 2011 at 02:24 AM 0
Share

By animation, do you mean a movie, or some scripted animation, or keyframe animation.... ?

avatar image Jessy · Jan 19, 2011 at 02:26 AM 1
Share

If you could make any effort whatsoever that would be great!

avatar image joe 7 · Jan 19, 2011 at 02:37 AM 0
Share

well, i do not know how to do it that is why i asked the question, and @DaveA s car would be in the sceen, and when you click it would drive away, and when that is done the first level loads

avatar image Jessy · Jan 19, 2011 at 03:11 AM 1
Share

Learn something, try something. Come here after if you get stuck. http://unity3d.com/support/documentation/

avatar image joe 7 · Jan 19, 2011 at 04:04 AM 0
Share

i tried this: var isQuit = false;

function On$$anonymous$$ouseUp() { if(isQuit) { Application.Quit(); } else { Application.LoadLevel(1); collider.gameObject.animation.Play("move");

 }

} ablviosly it didn't work because i do not know how to do it(that is why i asked the question). i got this error: $$anonymous$$issingComponentException: There is no 'Animation' attached to the "New Text" game object, but a script is trying to access it. i want the script to move the car. i look at you link, i tried it by myself, now please just answer my question

1 Reply

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

Answer by DaveA · Jan 19, 2011 at 02:29 AM

See: http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.OnGUI.html

It might look something like this (untested)

function OnGUI () {
    if (GUI.Button (Rect (10,10,150,100), "olay"))
    {
        GameObject.Find("myanim").GetComponent(Animation).Play();
        yield WaitForSeconds (5); // wait til animation done (probably not a good idea)
        Application.LoadLevel("myNextLevel");
    }
}

You might need to use a coroutine to do the animation and load next level. You might want the animation to have an event that fires to tell you it's done so you know when to load the next level.

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 joe 7 · Jan 19, 2011 at 05:28 AM 0
Share

i got this erreor: NullReferenceException textControl+On$$anonymous$$ouseUp$1+$.$$anonymous$$oveNext () (at Assets\textControl.js:19) UnityEngine.GameObject:Send$$anonymous$$essage(String, Object, Send$$anonymous$$essageOptions) UnityEngine.GameObject:Send$$anonymous$$essage(String, Object, Send$$anonymous$$essageOptions) UnityEngine.$$anonymous$$ouseOverPair:Send$$anonymous$$essage(String) UnityEngine.Send$$anonymous$$ouseEvents:DoSend$$anonymous$$ouseEvents()

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

Can You Animate Main Menu Title? 2 Answers

Playing animation elements not working 2 Answers

Changing two different objects renderer colour 1 Answer

Can the animation editor create local rotational data? 3 Answers

Adding animation clips via script 2 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