the player character in my game will not jump I have figured out that the input i set up is not comminating with the script
this is the script
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.InputSystem;
public class playerController : MonoBehaviour
{
public Rigidbody2D rb;
public LayerMask groundLayer;
public Transform groundCheck;
public float groundCheckRadis;
public float jumpPower;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void jump(InputAction.CallbackContext context)
{
if(isGrounded() && context.performed)
{
rb.velocity = new Vector2(rb.position.x, jumpPower);
}
if(context.canceled && rb.velocity.y > 0f)
{
rb.velocity = new Vector2 (rb.position.x, rb.velocity.y * .5f);
}
Debug.Log("Jump");
}
private bool isGrounded()
{
return Physics2D.OverlapCircle(groundCheck.position, 0.5f, groundLayer);
}
}