Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 theasian_baller · Mar 17, 2019 at 02:30 AM · buildbuild-error2d animation

2D Animation will not run after game is built

An annoying problem has come up for me. In the home stretch of making my game, my 2D jump animation (which works fine in the Unity Editor) decides to not work after exporting my game. Literally everything else works after the build except for the jump animation. I'm not sure what I'm doing wrong here, but any kind of help would be greatly appreciated!

EDIT: While the Unity Editor does show it to be working, whenever a scene is reloaded (ex: player dies, game over screen pops up, automatically restarts the level) the jump animation doesn't work unless I press the jump key twice (meaning a force is added to the player which makes the player jump, but the jumping animation itself is not playing unless I hit the jump button twice). Hopefully this information is helpful to those willing to help me out!

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 Nivbot · Mar 17, 2019 at 05:12 AM

Would probably need to see your jump code, the animator variable you are setting and or maybe a screenshot of your path to jump animation in the animator

Comment
Add comment · Show 3 · 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 theasian_baller · Mar 17, 2019 at 02:10 PM 0
Share

Here is my animator map for my player animations:

alt text

$$anonymous$$y jump code is in my Player$$anonymous$$ovement script, which branches off of a Brackeys 2D game tutorial in which he makes and lets people use his CharacterController2D script, which I have done (If you need that file I can provide that):

     void Update()
     {
         horizontal$$anonymous$$ove = Input.GetAxisRaw("Horizontal") * runSpeed;
 
         animator.SetFloat("Speed", $$anonymous$$athf.Abs(horizontal$$anonymous$$ove));
 
         if(Input.GetButtonDown("Jump"))
         {
             FindObjectOfType<Audio$$anonymous$$anager>().Play("Jump_SFX");
             jump = true;
             animator.SetBool("isJumping", true);
         }
 
         if (Input.GetButtonDown("Crouch"))
         {
             crouch = true;
         }
 
         else if(Input.GetButtonUp("Crouch"))
         {
             crouch = false;
         }
     }
 
     public void OnLanding()
     {
         animator.SetBool("isJumping", false);
     }
 
     public void OnCrouching (bool isCrouching)
     {
         animator.SetBool("isCrouching", isCrouching);
     }
 
     void FixedUpdate()
     {
         // $$anonymous$$ove the character
         controller.$$anonymous$$ove(horizontal$$anonymous$$ove * Time.fixedDeltaTime, crouch, jump);
         jump = false;
     }


Also, I have declared an animator variable, but the animator variable isn't set in the Start() method of my Player$$anonymous$$ovement script but works normally for the other player animations.

animation-map.png (48.1 kB)
avatar image Nivbot theasian_baller · Mar 17, 2019 at 04:02 PM 0
Share

what is your animation transition set at? If it is set to Has Wait Time click that off.

avatar image theasian_baller Nivbot · Mar 18, 2019 at 01:54 AM 0
Share

Has Exit Time has been off for all of the transitions to and from Player_Jump. I have an example of what the transition from the idle animation to the jump animation looks like here:

alt text

animator-inspector-ex.png (25.6 kB)

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

110 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 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 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 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 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

Distribute terrain in zones 3 Answers

iPhone build is a blank scene 0 Answers

Lighting layers error 1 Answer

Android Build 0 Answers

Android - Failed to repackage resources error after installing facebook plugin 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