Jump system isn't working

Hello I’m starting in unity and I’m actually trying to make a character controller and I’m trying to make a jump system but it’s not working. Can someone help me to solve my problem .This is the gravity script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerGravity : MonoBehaviour
{
    [SerializeField]
    bool isOnGround = false;
    RaycastHit Hit;
    [SerializeField]
    CharacterController controller;
    [SerializeField]
    public float Gravity = -7;
    [SerializeField]
    float GravityMultiplier;
    [SerializeField]
    public float GravityVelocity;
    public void FixedUpdate()
    {
        Debug.DrawRay(transform.position , transform.up*-1.2f, color:Color.red);
        if(Physics.Raycast(transform.position, Vector3.down,out Hit, 1.2f))
        {
            if (Hit.collider.CompareTag("OnGround"))
            {
                isOnGround = true;
            }
            
        }
        
        if (Hit.collider == null)
        {
            isOnGround = false;
        }

        if (isOnGround)
        {
            GravityVelocity = -1f;
        }
        if (!isOnGround)
        {
            GravityVelocity += Gravity * GravityMultiplier*Time.fixedDeltaTime;
        }
        controller.Move(new Vector3(0,GravityVelocity,0));
        
    }
}

this is the player motor script:

using System;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.UIElements;

public class PlayerMotor : MonoBehaviour
{
    bool isOnGround = false;
    RaycastHit Hit;
    //recuperation du rb
    [SerializeField]
    public Rigidbody rb;
    //recuperation du CharacterController
    [SerializeField]
    CharacterController controller;
    //Variables move
    [SerializeField]
    float xMove;
    [SerializeField]
    float zMove;
    //Variable pour récuperer la camera
    [SerializeField]
    Camera cam;
    //création des variables velocity et rotate
    public float jumpVelocity;
    public Vector3 velocity;
    public Vector3 xRotate;
    public Vector3 yRotate;

    //Récuperation de velocity dans Movement
    public void move(Vector3 _velocity,float _jumpVelocity)
    {
        jumpVelocity = _jumpVelocity*Time.fixedDeltaTime;
        velocity = _velocity;
    }
    //récuperation de xRotate et yRotate dans Movement
    public void rotate(Vector3 _xRotate, Vector3 _yRotate)
    {
        xRotate = _xRotate;
        yRotate = _yRotate;
    }
    void FixedUpdate()
    {
        if (Physics.Raycast(transform.position, Vector3.down, out Hit, 1.2f))
        {
            if (Hit.collider.CompareTag("OnGround"))
            {
                Debug.Log("OnGround");
                isOnGround = true;
            }
            
        }
        if (Hit.collider == null)
        {
            isOnGround = false;
        }
        jump();
        //application des mouvements
        controller.Move(transform.TransformDirection(velocity) * Time.fixedDeltaTime);
        if (xRotate != null)
        {
            transform.Rotate(xRotate * Time.fixedDeltaTime);
        }
        if (yRotate != null)
        {
            cam.transform.Rotate(-yRotate * Time.fixedDeltaTime);
        }
    }
    void jump()
    {
        if (jumpVelocity == 0) return;
        if (!isOnGround) return;
        controller.Move(new Vector3(0,jumpVelocity,0));
    }
}

and this is the movement script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Movement : MonoBehaviour
{
    //Variable des vitesses
    [SerializeField]
    float speed;
    [SerializeField]
    float mouseSensitivity;
    [SerializeField]
    float jumpForce;

    //Variable pour accéder a PlayerMotor
    public PlayerMotor playerMotor;
    
    void FixedUpdate()
    {
        //Variables Inputs
        float xInput = Input.GetAxisRaw("Horizontal");
        float zInput = Input.GetAxisRaw("Vertical");
        float yInput = Input.GetAxisRaw("Jump");
        float xMouse = Input.GetAxisRaw("Mouse X");
        float yMouse = Input.GetAxisRaw("Mouse Y");
        //vecteur de la souris

        Vector3 xRotate = new Vector3(0, xMouse * mouseSensitivity, 0);
        Vector3 yRotate = new Vector3(yMouse * mouseSensitivity, 0, 0);
        
        //calcule de la vélocité

        Vector3 xMove = new Vector3(xInput, 0, 0);
        Vector3 zMove = new Vector3(0, 0, zInput);
        Vector3 yMove = new Vector3(0, yInput, 0);
        Vector3 velocity = (xMove +zMove).normalized*speed;
        Vector3 jumpVelocity = yMove.normalized *jumpForce;
        //appel des fonction de PlayerMotor
        playerMotor.move(velocity,jumpVelocity.y);
        playerMotor.rotate(xRotate,yRotate);

    }

   
}

I hope that someone will help me to solve the problem.

Sounds like you wrote a bug… and that means… time to start debugging!

By debugging you can find out exactly what your program is doing so you can fix it.

Use the above techniques to get the information you need in order to reason about what the problem is.

You can also use Debug.Log(...); statements to find out if any of your code is even running. Don’t assume it is.

Once you understand what the problem is, you may begin to reason about a solution to the problem.

Remember with Unity the code is only a tiny fraction of the problem space. Everything asset- and scene- wise must also be set up correctly to match the associated code and its assumptions.

^ ^ ^ How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

This is the bare minimum of information to report:

  • what you want
  • what you tried
  • what you expected to happen
  • what actually happened, log output, variable values, and especially any errors you see
  • links to actual Unity3D documentation you used to cross-check your work (CRITICAL!!!)

The purpose of YOU providing links is to make our job easier, while simultaneously showing us that you actually put effort into the process. If you haven’t put effort into finding the documentation, why should we bother putting effort into replying?

If you post code, only post the relevant code and always use the format button above. Do not post photographs of code.