Character won't move on Builded version

Hello. I’d appretiate your help on this issue.

The project is completely done (a Super Mario Bross Level 1-1 clone for practice purpose), everything works as expected on the Editor, but the Build version has the character static when is grounded for some reason, whenever is landed on the ground or any platform, the rigidbody won’t move… curiously enough, whenever I jump it can move normally but stops moving once is grounded again.

Here is the error:

Here is the Editor showing it working as expected, the character will move as one would expect:

It’s been like that on Windows versions for 32 and 64 bits and also HTML5.

I already tried updating the project version to 2021.2.13f1 (the project version is 2019.4.36f1), and making a new project in the 2021.2.13f1 and putting the assets there, it works the same (well in the Editor and with the same error in the Build).

This is the movement code, tho it works wonders in the Editor so I don’t think this is the problem:

main._rigidbody.velocity = new Vector2(iostate.currentSpeed, main._rigidbody.velocity.y);

There are no errors on console or warnings, I’m checking with Unity Log Viewer, an AssetsStore package for viewing Debug.Log() output in build versions. Using AddForce() instead will move the player but I wanna try some solution that doesn’t involve touching the already working code.

That’s all, I hope someone can help me since I want to mark this little project as finalized.

Thanks in advance.

Nvm, solved it myself, but the thing that it behaved different depending on if in the Editor or the Build is still true, is there any way to avoid this to happen again?

I suppose that depends on what the problem was!

You would need to figure that out first.

The most common reason this sorta thing happens is:

  • failure to load resources properly (eg, using the filesystem as if it would still exist in build; it doesn’t)
  • timing sensitivities in the scripts (eg, if one script starts first, the other fails)
  • multi-camera layering that puts two layers in conflict; half the time you get nothing, for instance.

Thanks, I already solved it, I’ll be posting it on the forum any time these days. What I don’t get is why is it working differently on editor than on build, isn’t it supposed to be doing the same on background?