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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by IKilledKenny_2 · Jun 10, 2015 at 01:00 PM · animationjavascriptcollisioncollideranimator

How To Play Animation

Hello Unity3D.I have a question about animations?How can i make i that when my character plays a certain animation it plays another after that specific animation?For example,My character plays an animation named walking then if that character is playing that animation it plays an animation named run right after that animation automatically.If anyone knows how i can make my player play one animation if another one is playing.Can you please tell me how?

P.S Heres what i got so far

 var player : GameObject;
 var cam : GameObject;
 var Teleport : GameObject;
 var ground :  Transform;
 var RoarCameraPosition   : Transform;
 var Roar   : GameObject;
 var mouth  : Transform; 
 
 
 function Start (){
 
 if(!player.animation.IsPlaying("Burn_To_Hell_Part_2")){
 player.animation.Play("Jump");
 cam.transform.position = RoarCameraPosition.transform.position - RoarCameraPosition.transform.forward;
 cam.transform.Rotate(0,180,0);
 Instantiate(Roar,mouth.transform.position,mouth.transform.rotation);
 Switch2();
     }    
 
 }
 
 function Switch2 (){
 
 yield WaitForSeconds(3);
 Instantiate(Teleport,ground.transform.position,ground.transform.rotation);
 
     
         
 
 
 }
Comment
Add comment · Show 4
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 Wolfdog · Jun 10, 2015 at 09:28 PM 0
Share

You should seriously move on to the new animation system. It's much easier, more effective, and has more support. I learned it in under an hour, so it can't be that difficult to understand.

avatar image IKilledKenny_2 · Jun 10, 2015 at 09:32 PM 0
Share

are you reffering to mecanim?because everytime i use mecanim it messes up my characters animations

avatar image Calum1015 · Jun 10, 2015 at 11:25 PM 0
Share

I have to agree with @Wolfdog. $$anonymous$$ecanim is very useful. What do you mean it messes up your character animations anyway? All else to shame, you can use something like this: if(Animation.isPlaying("YourFirstAnimation") { Animation.PlayQueued("YourSecondAnimation"); } else { return; }

avatar image IKilledKenny_2 · Jun 11, 2015 at 02:35 AM 0
Share

like most of the animations looks all wiggly and the limbs move all over the place

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Geva93 · Jun 11, 2015 at 08:53 AM

you can do it easy throw mecanim, place "idle" state and then when you move place a "move" state and when the move state is finish you put after it a "run" state and it will automatic go to the "run" state

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

24 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

Related Questions

Decreasing Player Health On Collision with Enemy 2 Answers

Animation on Raycast Not Playing 1 Answer

How to make collision check if other collider has component 1 Answer

Play annimation on collision not working. 1 Answer

Can I use Animator.bodyPosition for modifying the colliders during an animation? 1 Answer


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