CharacterController works perfectly in-Editor, but is broken after Build

I’m currently developing a FPS game. The CharacterController works perfectly in the Unity Editor, but once I actuall build and run the game, it’s completely broken. The jump key might not work, if I jump, I’ll freeze in mid air, sometimes I press and release AWSD and the character keeps moving, etc. It’s complete non sense and I have no idea what is causing this.

Does anyone know why the CharacterController is broken in-game after building the game?

UPDATED: SOLVED

I updated the first post with a lot more information, including a video and a link to two playable builds.

This problem is now solved. It probably was a combination of Lowest Graphics settings combined with some shady things I was doing in the latest version of my movement script - frame rate related.

1 Like

I had a similar issue a while ago. It was caused by validating the movement speed and other values for the controller in the OnValidate() method, to keep the values within a valid range when changing them in-editor, and keep consistency between related values.

The problem being that OnValidate is only called within the editor, so after a build, the validation for the movement values wouldn’t be called, and the movement behaviour ended up being different.

I’m guessing your issue may have been something similar - i.e. some of your important movement-related code was editor-only code. Is that possible? I’m skeptical that it had anything to do with your graphics settings. :slight_smile:

1 Like