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 Radical Raymondd · May 25, 2013 at 12:20 AM · animationblenderthird-person

Making a character's idle animation loop. (model and animation created in blender)

I've tried everything that i can come up with. My game is almost finished it just need proper animations and i'm done. I made my model (made in blender, rigged in blender, animated in blender.) i make a animation controller and my idle animation does in fact work BUT it only plays once. I went to the animation and looked at it in the inspector tab and there is clearly a loop button but nothing in the menu is clickable (it is grayed out and does not respond to my attempts to click. Ive also tried exporting it as a FBX and doing the same process. NO LUCK. if you could please help me that would be great.

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

Answer by jerobinson · May 27, 2013 at 12:01 PM

Hey there,

Alright, so firstly when you import a model and animations from blender to unity, the "prefab" that you first drag into the scene view should not be used as your final player. The reason being that you cannot adjust the values of the initial components on it. Also if the character is deleted from the scene, you will have to set him up again.

Instead, add all of the additional components you want to add to it, then create a NEW prefab of it. This will allow you to adjust the animation settings etc, while the original imported gameobject is preserved in case you need to change it later on. This way, you can also add as many characters as you want to the scene.

As for controlling your animations, it is best to do this through script so that you have more control over them.

For example:

 using UnityEngine;
 using System.Collections;
 
 public class AnimationControl : MonoBehaviour {
 
     void Start () {
         //Set the wrapmode for each animation
         animation["Idle"].wrapMode = WrapMode.Loop;
         animation["Run"].wrapMode = WrapMode.Loop;
         animation["Jump"].wrapMode = WrapMode.Once;
         //Stop all animations from playing in case we forgot to do this in the inspector
         animation.Stop();
     }
     
     void Update () {
         //Play the run animation if vertical is pressed
         if(Input.GetButton("Vertical")) {
             animation.CrossFade("run", 0.2f);    
         }
         else if(Input.GetButtonDown("Jump")) {
             animation.CrossFade("Jump", 0.2f);    
         }
         else {
             animation.CrossFade("Idle", 0.2f);    
         }
     }
 }

Note that this code is untested and may require some tweaking to get it to work correctly.

Good Luck.

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

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

14 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

Related Questions

fbx animation to> blender 1 Answer

Recommendations for Animation Structure/Organization? 2 Answers

Is it possible to edit an armature once it is imported into Unity? 1 Answer

A very strange error regarding actions with .blend 1 Answer

Children won't animate 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