Hey there. I have a 2D game in a 3D scene with a player controller that plays animations with buttons and joysticks.
Everything works fine in the editor, but whenever I make a build, the animations only play sometimes on button click, even though the rest of the script plays. For example, I can attack an enemy, they lose health every time, although very randomly only about 1 in 10 times it will play the animation.
I feel like the animator is getting an error and therefore not playing the animation, although no errors come up in the log.
There’s also way more force being added with AddForce() when jumping and doing other things which I’ll look into.
I’m quite stuck here, so any help is appreciated.

This is it in the editor (working like normal):
This is in the build:
I can jump, walk, idle normally (except the jump has extra force for some reason…)
But when attacking, it will always play what’s in the script (eg. damage enemies) but the animation won’t play.
I’m having the same problem with animations not being played correctly in the build of the game but they work just fine in the editor apparently. I also have the jump problem error where in my editor, the force (AddForce for a dash ability) works properly but in the build sometimes the force is 1/2 of what its supposed to be or 1/4. I can’t even find the output.txt or the log that comes with the build, neither in GameName_Data or in the LocalLow place (in LocalLow/CompanyName, there’s a PlayerLog.txt file but that doesn’t give anything useful) for trying to see what happens when I run the build.
What could be the reason behind it? Should it be in update() or lateupdate()? Is it because its slightly laggy in the editor that everything is processed slightly slower than in the build and so these errors seem invisible? Its been killing me!
Its been around 3 months so did you ever find a solution?
Answering my own question here, I managed to find a “fix” for it by setting the FPS to 30 - 40 instead of letting it run wild at 200FPS (very simple game with not much graphics, therefore it was reaching high FPS easily). I think the problem might be because of my code/animation-conditions placements in the update function where which animation to be played, animation to be stopped etc. were being processed too many times (and maybe some processing the wrong thing to do) in one second and hence, weird animation errors. Also the AddForce inaccuracy has been apparently fixed by lowering the FPS. I wouldn’t really call this a fix but more like a dodge because I’m sure there must be something wrong with my code. My biggest problem, I guess, is that I’ve put everything in one script instead of separating it out (like I should have made one script for handling animations, one for the movement etc…)
EDIT: Nevermind, the AddForce inconsistency has returned!