Question by
zippiiichannel · Oct 10, 2019 at 09:27 AM ·
movementair
Mid-air movement,I've been looking everywhere to find a script that would help me move my character whilst in mid-air, if someone could point me in the right direction, i would appreciate it.
Hi, im stuck. I have looked on every site and have moved the movement controls above isGrounded and i just float down slowly and cant really jump... i got this far.
if (characterController.isGrounded) {
moveDirection = new Vector3 (Input.GetAxis("Horizontal"), 0.0f, Input.GetAxis("Vertical"));
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= speed;
if (Input.GetButton("Jump"))
{
moveDirection.y = jumpSpeed;
moveDirection = new Vector3 (Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical"));
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= speed;
}
}
moveDirection.y -= gravity * Time.deltaTime;
characterController.Move(moveDirection * Time.deltaTime);
}
}
,I only started doing on and off and on lve just about got the hang of it and how it works, anyway other than talking about myself. This is my code... I've tried every single site i could find but i just cant do it without gravity f** me up. I have moved the movement above isGrounded and i slowly float to the floor.
Comment