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 /
This question was closed Feb 22, 2014 at 11:05 PM by JayOhhh for the following reason:

The question is answered, right answer was accepted

avatar image
3
Question by JayOhhh · Feb 22, 2014 at 07:13 PM · animationanimator

2d Animation - Play once, then stop at end position

Hello,

I am currently trying to setup a title screen for my project. The title screen consists of three animations - TitleText1, TitleText2, CharcaterAnimation. All three of these componenets need to start off screen. I have animatons attached via animatior controllers to each object. Each animation brings the objects on screen, and performs some movement.

My question is, how can I get them to only play once and then show the objects at their finishing position?

So far this is my title screen manager class:

 public class TitleScreenManager : MonoBehaviour {
 
     public Animator titleScreen1;
     public Animator titleScreen2; 
     public Animator characterAnimation;
 
     public GameObject titleScreen1obj;
     public GameObject titleScreen2obj;
     public GameObject characterObj;
 
     // Use this for initialization
     void Awake () {
 
         titleScreen1obj = GameObject.Find ("TitleText1");
         titleScreen2obj = GameObject.Find ("TitleText2");
         characterObj= GameObject.Find ("CharacterObject");
 
         titleScreen1 = titleScreen1obj.GetComponent<Animator> ();
         titleScreen2 = titleScreen2obj.GetComponent<Animator> ();
         characterAnimation= characterObj.GetComponent<Animator> ();
 
         titleScreen1.SetBool ("playTitleBounce1", true);
         titleScreen2.SetBool ("playTitleBounce2", true);
         bounceyBounceAnim.SetBool ("playBounceIntro", true);
 
 
     
     }
     
     // Update is called once per frame
     void Update () {
 
 
      
 
     }

With this code I have no problem getting the animations to play, the only problem I'm comming up with is how do I set them to only play once? I have bool parameters setup in my animator that I use on awake to start the animations, but how do I stop them after they play through once? Also how can I have it so that the objects remain in their position that the end of the animation places them in?

Any help is apprecaited.

Thanks

Comment
Add comment
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

1 Reply

  • Sort: 
avatar image
26
Best Answer

Answer by _1 · Feb 22, 2014 at 10:02 PM

find the animation you are using and double click on it where it says loop time uncheck that

Best of luck :)

Comment
Add comment · Show 5 · 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 JayOhhh · Feb 22, 2014 at 10:44 PM 0
Share

Oh wow haha how simple! Don't I feel silly :)

Thanks for your time and response, worked perfectly!

avatar image _1 · Feb 22, 2014 at 11:31 PM 0
Share

no problem I'm glad I helped :)

good luck with your game

avatar image haroonkhan38 · Jun 15, 2015 at 05:14 PM 0
Share

good. it helped me. thank you dear

avatar image deviantony · Feb 11, 2016 at 08:46 PM 0
Share

So simple but helped me too ! Thanks !

avatar image iamgabrielma · Nov 04, 2017 at 10:00 PM 0
Share

Been stuck with this for nearly an hour, editing code and trying to figure out how to stop the animation. Thanks.

Follow this Question

Answers Answers and Comments

22 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

2D Animation does not start 1 Answer

Animator has not been initialized!!!!!! Help!! 2 Answers

UI Text Alpha not fading out in animation 0 Answers

UFPS - Player Animation Setup 0 Answers

Blending between frames in the same animation (fake stop motion) 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