Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Netcode jump height difference between build and editor

Discussion in 'Multiplayer' started by muco34dem, Aug 31, 2023.

  1. muco34dem

    muco34dem

    Joined:
    May 6, 2019
    Posts:
    1
    Hello, I am making a simple shooter using netcode. In the build, it jumps about 2 times more height than the editor, does anyone have a solution for this?


    My method :

    private void Jump()
    {
    if(!isGrounded)
    return;
    if (Input.GetKeyDown(KeyCode.Space))
    {
    isGrounded = false;
    Rb.velocity = new Vector3(Rb.velocity.x, Mathf.Sqrt(2* jumpForce * Mathf.Abs(Physics.gravity.y)),Rb.velocity.z);
    }
    }