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 mkjrfan · Feb 08, 2013 at 01:34 AM · animationdirectionattack

Left can Animate but right cannot. Why?

For some reason I have this probelm where the left animation for hitting works, but the right works part of the way.

My code:

  1. if(xa.attacking && !xa.onSkateboard ) {

            2. if(xa.facingDir==1){
                     3. if (currentAStates!=xa.aStates.second && canA2==true )
                     {
                         print("Second Attack");//second attack
                         mySprite.PlayOnce("aRight" );//Attack Left
                         currentAStates = xa.aStates.second;
                     }
                     4. else if (currentAStates!=xa.aStates.third && canA3==true )
                     {
                         print ("Third Attack");//third attack
                         currentAStates = xa.aStates.third;
                         mySprite.PlayOnce("GoSL" );
                     }
                     5. else if (currentAStates != xa.aStates.first && canA2!=true && canA3!=true){
                     mySprite.PlayOnce("aLeft" );//Attack Left
                     print ("First Attack");
                     currentAStates = xa.aStates.first;    
                     }
                 }
                     
                  6. if(xa.facingDir==2){
                     if (currentAStates!=xa.aStates.second && canA2==true )
                     {
                         print("Second Attack R");//second attack
                         mySprite.PlayOnce("aLeft" );//Attack Left
                         currentAStates = xa.aStates.second;
                     }
                     7. else if (currentAStates!=xa.aStates.third && canA3==true )
                     {
                         print ("Third Attack R");//third attack
                         currentAStates = xa.aStates.third;
                         mySprite.PlayOnce("GoSR" );
                     }
                     8. else if (currentAStates != xa.aStates.first && canA2!=true && canA3!=true){
                     mySprite.PlayOnce("aRight" );//Attack Left
                     print ("First Attack R");
                     currentAStates = xa.aStates.first;    
                     }
                 }
                 
                 
                 
             }
    
    

Now I'm not sure what excatly isn't told but ill try and give the most information I can. If you have any questions just ask.

basicly the 1st if statement is asking if the the palyer is attacking and if s/he is on the skateboard. The anwser will always be yes, no for this example allowing it to move on.

the next if statement is checking the direction the player is facing (1=left, 2=right).

In the 3rd if Statement it checks if its attack state is second and if it can do second attack(canA2). 4 is the same but checking if it can do the third attack.

5th is if it can't do both 2nd and 3rd then it will do the 1st attack and become the 1st attack state. 2-5 work and they animate correctly. 6-8 work in the sense that all attacks are printed (which notifies me when it works), but it doesn't animate.

There is more code to it which changes the currentAStates(current attack state) but I don't think that is the probelm since it does seems to process through the code because it does the print "First Attack R" and does the first attack animation, but the 2nd and 3rd don't animate. Any idea on why this is happening? (Using Orthello2d)

Comment
Add comment · Show 1
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 mkjrfan · Feb 08, 2013 at 10:36 PM 0
Share

Is there no answer to my question or did I not explain it well enough?

0 Replies

· Add your reply
  • Sort: 

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

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Playing animations by velocity for the correct direction. 0 Answers

Getting animations to play relative to player's direction? 4 Answers

How to fix rig animation that stops short when increasing speed? 0 Answers

Can I make animations snap to a frame? 1 Answer

What is the best way to manage the attack and auto-attack animation per second when the object collides?,Best way to make 2 objects attack per time each other when colide? 0 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