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 torak289 · Dec 11, 2014 at 10:56 AM · animationtouch controlscharacter-animationstopping-animation

Mecanim Animation won't stop looping.

Hello, I have set up a walk/run cycle for a Character that I am playing with. I am having an issue where on touch input the Mecanim transition will take place (playing the animation) but the animation will not stop looping, but it will transition back to the Walk/Run start for 20 frames and loop back into the animation. But if I touch the screen again the animation will stop playing and return to the walk/run state of the Mecanim animation.

I was wondering whether I was using the wrong touch input, I am using this:

     //Touch Input Jump
     foreach (Touch touch in Input.touches) 
     {
         if (touch.phase != TouchPhase.Ended && touch.phase != TouchPhase.Canceled)
         {

or there was something wrong with the way I have setup the Mecanim.

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 meat5000 ♦ · Dec 11, 2014 at 01:13 AM 0
Share

Add more parameters in the state machine.

$$anonymous$$ake a default state with either an idle animation or leave it empty and make sure there is a solid parameter to transition away from the default state. Also check out Exit Time parameter.

avatar image torak289 · Dec 11, 2014 at 08:03 AM 0
Share

This is how I currently have the animator set out. I edited it to fit with what you have said but it is still causing the issue!

these are 2 screen shots of what I have currently. Screen Shots

please point out if I am overlooking something simple (very likely).

avatar image meat5000 ♦ · Dec 11, 2014 at 09:05 AM 0
Share

Change the loop condition on the import tab after clicking the model or anims prefab.

I only see an exit time parameter under the transition you have clicked on. You have parameters speed and jump but if you dont enter it under conditions for the transition they dont do anything.

Click each transition arrow and add conditions as appropriate under 'Conditions'.

avatar image torak289 · Dec 11, 2014 at 01:50 PM 0
Share

Thanks for the reply I will have a go with that now cheers.

avatar image torak289 · Dec 11, 2014 at 09:49 PM 0
Share

I tried everything you said might fix it but after no success. I don't know what to do is there some other way of animating characters?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by torak289 · Dec 12, 2014 at 02:28 PM

I managed to fix the issue with the looping animation. I had put the else statement in the script in the wrong location in association with the touch input, but as soon s I had fixed that everything started to work like a dream.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

My Unity game randomly freezes with no error or warnings, HALP? 2 Answers

Can I make animations snap to a frame? 1 Answer

How to create new animations for the built-in character 1 Answer

if (Input.GetKey(KeyCode.W) && Input.GetKey(KeyCode.LeftShift)) with , PlayMode.StopAll);???? 1 Answer

Humanoid Rig breaking animations that work fine as Generic 5 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