So yeah, when I play test it, I get error in the line of the mouse0 input. Any idea?
Attack Script:
public float attackRate = 2f;
float nextattackTime = 0f;
public PlayerController PlayerController;
void Update()
{
if (Time.time >= nextattackTime)
{
if (Input.GetKeyDown(KeyCode.Mouse0) && (PlayerController.isJumping == true))
{
CritAttack();
nextattackTime = Time.time + 1f / attackRate;
}
}
}
Movement script:
void OnTriggerEnter2D(Collider2D collision)
{
if(collision.gameObject.tag == "Platform")
{
isJumping = false;
}
}
void OnTriggerExit2D(Collider2D collision)
{
if (collision.gameObject.tag == "Platform")
{
isJumping = true;
}
}