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 AusAndrew19 · Sep 02, 2012 at 01:30 PM · programming

Why does this script only play like 0.3% of my animation

Hi Guys I'm using

 function Update()
 {
  if(Input.GetKeyDown("1"))
  {
   // Plays the animation - stops all other animations
   animation.Play("attack 1", PlayMode.StopAll);
  }
 }


This Script Plays The Animation but it only plays like 2 frames then stops.. is there a way to make a public Variable to adjust how long it will play so i can zone on the correct amount of frames? or is there anyway to force it to play all not just 2 frames.

Only way i can get it to play is to spam "1" but makes it SOOO Choppy and that doesnt really look good.

Comment
Add comment · Show 3
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 AlucardJay · Sep 04, 2012 at 08:42 AM 1
Share

@AusAndrew19 , when are you going to start accepting answers? Currently only 5 out of 35 questions are accepted. You do realize that you also gain karma by accepting answers?

avatar image AusAndrew19 · Sep 04, 2012 at 08:53 AM 0
Share

Um ill accept when the answer is Answerd. This question is still open so why make it accepted if its not correct? I'll accept the answer as correct when i get a right answer.

avatar image AlucardJay · Sep 04, 2012 at 09:02 AM 2
Share

I wasn't referring to this question, rather all your past questions. Just looking at your last 3 questions, you have not commented, replied, left feedback or asked further questions in comments for clarification. So either you are taking the advice and help, or not. Either way, you have been given answers, and not responded (by comment or acceptance). This is a knowledge-base, meant to help anyone who searches this 'site.

Another point : you seemed happy with my answer to : http://answers.unity3d.com/questions/278058/how-to-add-a-sound-to-this-script.html

quote : Oh mate thank you! i didnt see that all. Sorry :) Thank you heaps. This works completely. thank you buddy :)

yet, my point remains the same ....

This is not a karma grab by me, I have over 2$$anonymous$$ which is all I require. Just letting you know that there is karma there for you, but most importantly trying to help keep the 'site organized.

1 Reply

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

Answer by Bunny83 · Sep 02, 2012 at 01:47 PM

Well, when you start an animation with Play it will play the animation. The only reasons for this behaviour i can think of would be:

  • You overwrite the animation somewhere else, maybe in another script.

  • The bounds of your model is wrong, so Unity thinks it's not visible. Try to set the cullingType to AlwaysAnimate. If it plays you're model has messed up bounds which should be fixed.

  • Make sure you don't have set your timescale to 0.0.

Comment
Add comment · Show 11 · 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 Khada · Sep 02, 2012 at 01:50 PM 0
Share

And make sure the animation plays as expected in the animation viewer. If not, it could well be the animation itself :)

avatar image AusAndrew19 · Sep 02, 2012 at 01:54 PM 0
Share

Okay so i changed cullingType to AlwaysAnimate. This suggestion didnt work.. I'm not to sure what timescale is? also no other script uses the animation. Checked animation. Runs perfect in unity3D Animation window.

avatar image AusAndrew19 · Sep 02, 2012 at 02:06 PM 0
Share

also my animations are "Split" Because the main mesh had one animation "Take 001" but i followed the guide when i baught the model. and it works in unity3d animation window so i have no idea why this is happening

avatar image Khada · Sep 02, 2012 at 02:08 PM 1
Share

A good place to start would be to make a new project, but nothing except the model with animations and a script to play them inside and see if everything plays as expected.

If not, it's the animation or a bug. If yes, it's something specific in your project. At least you know with side to look at then.

avatar image AusAndrew19 · Sep 06, 2012 at 05:54 AM 1
Share

I created a new project completely and then only added my model. made attack 03 the main one to play when i click play and it works fine.. As i said in my main project i had the same thing happen my AI could attack me completely no probs but when i try it only plays like 2 frames.

Show more comments

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

10 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

Related Questions

Multiple Cars not working 1 Answer

How to create a gui button inside an if statement? 1 Answer

Player is running just few seconds 0 Answers

need help with a script 1 Answer

I'm already an experienced programmer, is there anywhere great to go to get familiar with the libraries available in unity? 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