So I have a jumping script… (Keep in mind this is part of a bigger script so I only selected the part I needed.
///Jumping
if (onGround)
{
if(Input.GetKey(KeyCode.Space) || Input.GetKey(KeyCode.Return))
{
rb.velocity = new Vector3(0f, CharacterJumpStrength, 0f);
onGround = false;
}
}
}
void OnCollisionEnter(Collision other)
{
if (other.gameObject.CompareTag(“Ground”))
{
onGround = true;
}
}
And the script works great. However, the only problem I have is when I’m falling down, my character slowly falls and I don’t like that. I tried messing with the settings but it doesn’t work. Is it possible to have a script with a float that changes the strength of gravity?