Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 Ejpj123 · Jun 12, 2016 at 02:50 AM · animationstopplayingonlyone

Only one animation playing NON-STOP!!?

Hi, I am making a 2D game and I am having trouble with my player. For some reason when I run the game, It just keeps playing a jump animation for my character:

alt text

That is a picture of the end of the jump animation.

The animator is fine. The animations have the correct frames. Everything seems right, except for when you actually play the game. Will someone please help me?

screen-shot-2016-06-11-at-94456-pm.png (311.8 kB)
Comment
Add comment · Show 15
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 Iplaydev1 · Jun 12, 2016 at 03:02 AM 0
Share

Can you post a GIF of the problem?

avatar image Ejpj123 Iplaydev1 · Jun 12, 2016 at 04:09 AM 0
Share

If you give me your email, I can dropbox it to you because the size of the gif is to big, even when compressed.

avatar image Mmmpies · Jun 12, 2016 at 07:25 AM 0
Share

Watching a character jumping up and down isn't going to tell us anything we don't know already.

If you have the window for your animator open and deselect maximize on play you can see what settings are being triggered. Assu$$anonymous$$g you're using $$anonymous$$ecanim when you say Animator.

avatar image Ejpj123 Mmmpies · Jun 12, 2016 at 04:22 PM 0
Share

The correct settings are being triggered. The frames are also correct. This is a 2D game, by the way, and I think $$anonymous$$ecanim is for 3D?

EDIT: Oh, wait. Now the animator is not working.

alt text

EDIT 2: When I run the game, sometimes the animator works, and sometimes it doesn't, but either way, the jump animation plays the whole time.

screen-shot-2016-06-12-at-112438-am.png (494.6 kB)
avatar image Ejpj123 Mmmpies · Jun 13, 2016 at 09:34 PM 0
Share

Can you please help? Or Anyone?

avatar image Cherno Ejpj123 · Jun 13, 2016 at 10:49 PM 0
Share

There's not enough information to give a solution.

Check all the transitions between your animation states, and cross-reference the animation controller's variables with your scripts, especially any character controllers you might use.

Show more comments
Show more comments
avatar image Ejpj123 · Jun 14, 2016 at 12:50 AM 0
Share

@wojtask12 If you mean the functions from the script, then it is the FixedUpdate function -

 private void FixedUpdate()
         {
             m_Grounded = false;
 
             // The player is grounded if a circlecast to the groundcheck position hits anything designated as ground
             // This can be done using layers ins$$anonymous$$d but Sample Assets will not overwrite your project settings.
             Collider2D[] colliders = Physics2D.OverlapCircleAll(m_GroundCheck.position, k_GroundedRadius, m_WhatIsGround);
             for (int i = 0; i < colliders.Length; i++)
             {
                 if (colliders[i].gameObject != gameObject)
                     m_Grounded = true;
             }
             m_Anim.SetBool("Ground", m_Grounded);
         }
 

then the move function-

 public void $$anonymous$$ove(float move, bool jump)
         {
             //only control the player if grounded or airControl is turned on
             if (m_Grounded || m_AirControl)
             {
                 // The Speed animator parameter is set to the absolute value of the horizontal input.
                 m_Anim.SetFloat("Speed", $$anonymous$$athf.Abs(move));
 
                 // $$anonymous$$ove the character
                 m_Rigidbody2D.velocity = new Vector2(move*m_$$anonymous$$axSpeed, m_Rigidbody2D.velocity.y);
 
                 // If the input is moving the player right and the player is facing left...
                 if (move > 0 && !m_FacingRight)
                 {
                     // ... flip the player.
                     Flip();
                 }
                     // Otherwise if the input is moving the player left and the player is facing right...
                 else if (move < 0 && m_FacingRight)
                 {
                     // ... flip the player.
                     Flip();
                 }
             }
             // If the player should jump...
             if (m_Grounded && jump && m_Anim.GetBool("Ground"))
             {
                 // Add a vertical force to the player.
                 m_Grounded = false;
                 m_Anim.SetBool("Ground", false);
                 m_Rigidbody2D.AddForce(new Vector2(0f, m_JumpForce));
             }
         }
avatar image Ejpj123 · Jun 18, 2016 at 01:48 AM 0
Share

@wojtask12 @Cherno Turns out the jumping is a collider problem.

It looks like he is floating on a platform. alt text

Any Ideas?

BTW, he is not jumping.

screen-shot-2016-06-17-at-83630-pm.png (49.2 kB)

2 Replies

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

Answer by purnjay · Jun 15, 2016 at 06:23 AM

the problem is that you are keeping transition from any state to jumping so when the game will start it will first go to idle animation and then jump and then it will replay again and again .....

It would be good If you will also give a list of the parameters and where you have used them ..

but I think this is the problem..

Comment
Add comment · Show 2 · 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 Ejpj123 · Jun 21, 2016 at 08:21 PM 0
Share

Thank you, how would I fix it?

avatar image Cramshell Ejpj123 · May 16 at 10:06 AM 0
Share

How would you fix it?

avatar image
0

Answer by kittc522 · May 17 at 02:18 PM

Make sure on the animation you disable looping. Also, like purnjay said, it's possible you are transitioning between two animations over and over. In the Animator make sure if it's going from idle or any state to the jump that the there you don't have an arrow pointing from both objects to each other. It should look something like this but with jump in place of the run animation. Make sure there isn't an arrow pointing back at idle because that will create a loop of jumping back and forth between the two.alt text

Hopefully this helps? I'm not exactly sure what the problem is but that would be my guess :)


screenshot-2022-05-17-91329-am.png (21.2 kB)
Comment
Add comment · Show 4 · 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 kittc522 · May 17 at 04:11 PM 0
Share

@Cramshell ^

avatar image Cramshell kittc522 · May 17 at 11:20 PM 0
Share

thanks____

avatar image Cramshell Cramshell · May 17 at 11:45 PM 0
Share

Thanks so much!!!!!!!!

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

92 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

Related Questions

Play a video on clicking on an object 1 Answer

Jump to a specific frame in an animation 6 Answers

Walking Animation 1 Answer

Stop the Update function so death animation can complete. 1 Answer

How to stop animation state after some time (1 seconds) 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