- Home /
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!
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
Here is my animator map for my player animations:

$$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.
what is your animation transition set at? If it is set to Has Wait Time click that off.
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:

Your answer
Follow this Question
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