currently i have a jump meter that charges up when holding down jump then applies the velocity when released. if holding W when jump is released i want there to be an extra forward velocity. here is my code that doesnt work although the debug is saying that forward force is being applied
canJump = Physics.CheckSphere(GroundCheck.position, CheckDistance, GroundMask);
if (canJump && Input.GetKeyDown("space"))
{
canMove = false;
}
if(canJump && Input.GetKey("space") && JumpForce <= 25f)
{
JumpForce += 17f * Time.deltaTime;
}
if(canJump && Input.GetKeyUp("space"))
{
canMove = true;
if(Input.GetKey(KeyCode.W))
{
ForwardForce = 40f;
}
rb.velocity = new Vector3(0f,JumpForce,ForwardForce);
Debug.Log(rb.velocity);
JumpForce = 0;
ForwardForce = 0;
}