- Home /
Found the answer on a different forum.
Inconsistent add force across PCs
So I'm having a very strange issue with Unity. I'm currently using Add.Force muliplied with a jumpheight float and Time.DeltaTime to make my 2D character jump it works as expected in the editor but when I make a build the character won't jump at all unless I'm screen sharing in Discord at which point it jumps twice the high it should. Stranger still if my friend try the build on their computer the character jumps every time with the extra height. I've tried updated to the latest Unity version and importing the character as a prefab but the issue still persists. Dose anyone have any ideas about what could be causing this?
Heres My code:
//Jump if (grounded == true) { if (Input.GetKeyDown(KeyCode.Space)) { grounded = false; transform.GetComponent<Rigidbody2D>().AddForce(Vector2.up * _jumpForce * Time.deltaTime); } }