Changing shape of player jump path
I'm working on making a basic jump but am looking for specific behavior in the jump. I'm using a Character controller and this is my current basic code:
void FixedUpdate () {
//Basic Movement
move.x = Input.GetAxis("LeftJoystickHorizontal") * speed;
if (con.isGrounded)
{
move.y = 0;
if (Input.GetButtonDown("AButton"))
{
isJumping = true;
move.y = jump;
}
}
if(useGravity)
move.y -= gravity * Time.deltaTime;
con.Move(move * Time.deltaTime);
}
In the inspector: jump = 15 gravity = 50 speed = 10
I can modify these values to change the size of this jump, and the speed it's executed, but I want the physical shape to change, the parabola.
I put a line renderer on the player so you can see the current shape of the jump.
whereas this is the shape I would like to get out of the jump:
Where the player jumps up, would spend an unrealistic amount of time at the height of their jump, before falling back down.
I've been unable to wrap my mind around modifying the existing physics to accomplish this.
Thanks.
Your answer
Follow this Question
Related Questions
player jumping issue 1 Answer
Turn off y velocity in 2d Platformer 0 Answers
Charcter physics and groundedness 0 Answers
Rigidbody can push but can't be pushed 2 Answers
Character landing 0 Answers