Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 hexagonius · Nov 16, 2016 at 10:16 AM · animatorstartstop

Animator Stop and Start

I am using an Animator with an empty "NoState" and an animated state "TakeOff". TakeOff is the name of the state as well as the Motion clip name. I have set up a transition between them back and forth bases on a bool, but it's not important right now. The animator could just have one state I guess. What I can't get to work is calling Stop() on the Animator and at another point in time get Play() to play whatever I want to play.
It does not matter how I call Play(), the Animator refuses to start playing. I called it with Play("NoState",0), with Play("TakeOff",0), does not matter, it won't start.

I need this because I created a particular dolly shot but want to animate the camera programmatically for the rest of the time until I need the animation again and the Animator overrides the value while running.

Ho do I get the Animator to start playing anything after stop has been called once?

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

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

Answer by SlimeEnthusiast · Feb 12, 2017 at 05:50 PM

Please have a look at the documentation for Animator, particularly the SetBool function

https://docs.unity3d.com/ScriptReference/Animator.html

You really shouldn't need to ever stop the animator, even if you are animating the camera programmatically at times. When you want the animation to fire, just set the bool you are using to true and use SetBool on the animator. Other than that, programmatically animate your camera as you see fit.

Comment
Add comment · Show 2 · 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 hexagonius · Feb 15, 2017 at 01:11 PM 0
Share

I can't really try that anymore, but it sounds like a valid solution, thanks :)

avatar image ModLunar · Jan 31, 2018 at 12:06 PM 1
Share

Not to be annoying haha but I do think there are times where one might want to manually control the Animator.

Hopefully this isn't too far off topic but like right now, I'm using the underlying Playables API, I want to blend an Animator Controller with 1 to 2 timelines simultaneously in one PlayableGraph. But my issue is that when I place the AnimatorControllerPlayable in my custom graph, its like playing that same Animator twice, so I was trying to see if I could stop the Animator but play it using my own graph so I can more flexibly control it

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

63 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 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 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

Automatically playing animations 1 Answer

Timer that stops at the end of the game 3 Answers

Starting a new animation, after stopping another. Without transitions. 1 Answer

Coroutine start and stop 2 Answers

How to end an animator animation using time? 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