Make the jump smooth Unity C#

Hey guys, i’m trying to make my player jump smoothly instead of telephoning.

if(Input.GetButton("Jump") && playerContoller.isGrounded){//if player controller is grounded, we can do things
            //we will allow the player to jump;
            //we will get key down to see if it's true and player is grounded
            transform.position += new Vector3(0,1,0) * jumpSpeed;

            //to make player jump we need to;
//            playerContoller.Move((Vector3.up) * 10 * Time.deltaTime);//this forces player controller to move in the y axis
           
        }[/code

Any ideas where i have gone wrong?
If so can anyone point me in the Vector3.right direction(lol).

You’ll need to change the player’s speed over time to simulate the physics of the jump. The API docs for the Move method have an example showing exactly what you need.

Hey thanks for reply, i did check out move and Simple move but could not apply it to my code. Simple move does not have jump example. hence the Vector3.up

        Vector3 forward = transform.TransformDirection(Vector3.forward);//transdir takes another vector 3

        float speed = forwardSpeed * Input.GetAxis("Vertical");

//        transform.Translate(0,0,speed);
       
        //we are calculating a postive or negative value for speed
        //vector 3. forward means which way our tranfrom is looking so we can apply speed
       
        playerContoller.SimpleMove(speed * forward );
//        playerContoller.Move(moveDirection * Time.deltaTime);

        if(Input.GetButton("Jump") && playerContoller.isGrounded){//if player controller is grounded, we can do things
            //we will allow the player to jump;
            //we will get key down to see if it's true and player is grounded
            //    transform.position += new Vector3(0,1,0) * jumpSpeed;
            //            forward.y = jumpSpeed;

//            speedjumpSpeed;
            //to make player jump we need to;
//            playerContoller.Move(Vector3.up);//this forces player controller to move in the y axis
           
        }

Any ideas please?

Use a rigidbody with the AddForce method.

Hey. im using a character controller though.

for smooth jump u must use force and mode impulse

You can add Y component to the transform position via something like Mathf.MoveTowards, Mathf.Lerp, or via Vector3.MoveTowards / Vector3.Lerp. Pick your poison.

Alternatively as suggested, you could use rigidbody (just don’t use both CC & Rigidbody)/