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 ryandotdee · Feb 06, 2015 at 04:10 PM · animationblenderunity 4.6

Blender Animation loops when it should not

Hi,

Pretty new to unity, and have come across my first snag that I have not been able to find a solution to, hopefully someone here will be able to help :)

I have made a basic door in blender, which I have imported into unity. The door has a 70 frame animation, first 30 frames is opening, last 30 frames is closing.

I have created an animator, and an animator controller, and have broken the animation into 3 clips, idle, open and close.

I have created a script and assigned it to the door model.

 bool PlayerInCollider;
     Animator anim;
 
     // Use this for initialization
     void Start () {
     
         anim = GetComponent<Animator> ();
 
     }
     
     // Update is called once per frame
     void Update () {
 
         if (PlayerInCollider) {
             if(Input.GetKey(KeyCode.E))
             {
                 Debug.Log ("Triggered");
                 anim.SetTrigger("Open");
             }        
         
         }
 
     }
     void OnTriggerEnter(Collider obj) {
 
         Debug.Log (obj.transform.tag);
         if (obj.transform.tag == "Player") 
         {
             PlayerInCollider = true;
         }
 
     }
 

alt text

So, when I walk up to the door and press e, the door open animation plays, but it keeps looping, I have nchecked the loop time box, and am really baffled as to why this is happening?

My animator settings are below, any help would be appreciated!

alt text

screen-shot-2015-02-06-at-152109.png (56.9 kB)
screen-shot-2015-02-06-at-152053.png (26.5 kB)
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
0
Best Answer

Answer by carrollh · Feb 06, 2015 at 04:16 PM

Add a transition back to DoorIdle that works once the DoorOpen animation finishes.

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 ryandotdee · Feb 06, 2015 at 04:38 PM 0
Share

Hi, thanks for the comment. That does work, although I was under the impression that a trigger caused the animation to play once? Anywho, I added a new clip for idleopen, and I have got it to work now. $$anonymous$$any Thanks

avatar image carrollh · Feb 06, 2015 at 04:44 PM 0
Share

Well, I think the way a Trigger works is that it sets a boolean to true, then sets it back to false as soon as the animation finishes. But your state machine takes priority and there wasn't a way for it to get back to idle. So it had to stay in DoorOpen. I think the transition back to idle could be done with a boolean (if you had one) or with the animation time out. Or with a new animation like you did.

Glad you got it working.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

model isnt animating in 3rd person 1 Answer

Problematic blur with skeletal animation 1 Answer

Animation from a Blender model not looping 1 Answer

Can I make animations snap to a frame? 1 Answer

Blender Animation Looping Delay Problem 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