No Gravity Jump
Hi,
I'm trying to make a script so that the player jumps where the camera is facing, like he is jumping in a no gravity environement. I tried to use transform.foward but the problem is I don't want for the player to change the jump direction while he is jumping so that he can look around while jumping to a straight direction.
Any ideas?
EDIT : I used an Impulse force. Everything is fine.
if (Input.GetKeyDown(KeyCode.Space) && IsGrounded == true)
{
IsGrounded = false;
GetComponent<Rigidbody>().AddForce(transform.forward * 10, ForceMode.Impulse);
Just add a force to .forward direction to start the jump and disable that possibility until the player becomes grounded again and can jump again? I guess you are using 3D physics? You are not giving much details nor showing any code so it's hard to say what is going wrong
I'm using 3D physics and I have a bool for IsGrounded. Can you tell me how to do that force you're talking about?
Your answer
Follow this Question
Related Questions
Ai sprite animation 8 directional movement 0 Answers
Virtual camera odd behaviour. Scriptting noob questions 0 Answers
local Physics 0 Answers
Air Control While Jumping? 1 Answer