Hello, I wrote a simple script only for first-person-view character to jump. It works pretty well in editor runtime but not in standalone pc build or WebGL build. The code was first in the movement controller script where it had faced similar problem; I took out and tried several things that did not really work. Would you mind sharing any possible methods I should go and check? FYI, I left .isGrounded for the game purpose.
[SerializeField] private float jumpSpeed = 7.0f;
private Rigidbody rb;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update()
{
float _yMovement = Input.GetAxis("Jump");
//Apply jump
if (Input.GetAxis("Jump") != 0 || Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.V) || Input.GetKey("space"))
{
rb.AddForce(new Vector3(0, _yMovement * jumpSpeed, 0), ForceMode.Impulse);
}
}